@@ -104,7 +104,7 @@ def ping(self):
104104 return response .json ()
105105
106106 @log_decorator ("exception" )
107- def create (self , series = None , wait_on_verification = True ):
107+ def create (self , series = None , wait_on_verification = True , dynamic_read_timeout = False ):
108108 """
109109 Create a new series in DataReservoir.io from a pandas.Series. If no
110110 data is provided, an empty series is created.
@@ -124,6 +124,12 @@ def create(self, series=None, wait_on_verification=True):
124124 validation is successful. The latter is significantly faster, but
125125 is recommended when the data is "validated" in advance.
126126 Default is True.
127+ dynamic_read_timeout : bool (optional)
128+ While uploading file there is no timeout for read operations which can cause
129+ problems when there is no response from the server. If this flag is set to true,
130+ application will calculate and apply timeout for read operations and retry upload
131+ if necessary.
132+ Default is False.
127133
128134 Returns
129135 -------
@@ -157,7 +163,7 @@ def create(self, series=None, wait_on_verification=True):
157163 environment .api_base_url + "files/commit" ,
158164 {"json" : {"FileId" : file_id }, "timeout" : _TIMEOUT_DEAULT },
159165 )
160- self ._storage .put (df , target_url , commit_request )
166+ self ._storage .put (df , target_url , commit_request , dynamic_read_timeout )
161167
162168 if wait_on_verification :
163169 status = self ._wait_until_file_ready (file_id )
@@ -173,7 +179,7 @@ def create(self, series=None, wait_on_verification=True):
173179 return response .json ()
174180
175181 @log_decorator ("exception" )
176- def append (self , series , series_id , wait_on_verification = True ):
182+ def append (self , series , series_id , wait_on_verification = True , dynamic_read_timeout = False ):
177183 """
178184 Append data to an already existing series.
179185
@@ -193,6 +199,12 @@ def append(self, series, series_id, wait_on_verification=True):
193199 validation is successful. The latter is significantly faster, but
194200 is recommended when the data is "validated" in advance.
195201 Default is True.
202+ dynamic_read_timeout : bool (optional)
203+ While uploading file there is no timeout for read operations which can cause
204+ problems when there is no response from the server. If this flag is set to true,
205+ application will calculate and apply timeout for read operations and retry upload
206+ if necessary.
207+ Default is False.
196208
197209 Returns
198210 -------
@@ -217,7 +229,7 @@ def append(self, series, series_id, wait_on_verification=True):
217229 {"json" : {"FileId" : file_id }, "timeout" : _TIMEOUT_DEAULT },
218230 )
219231
220- self ._storage .put (df , target_url , commit_request )
232+ self ._storage .put (df , target_url , commit_request , dynamic_read_timeout )
221233
222234 if wait_on_verification :
223235 status = self ._wait_until_file_ready (file_id )
0 commit comments