File tree Expand file tree Collapse file tree 1 file changed +12
-8
lines changed Expand file tree Collapse file tree 1 file changed +12
-8
lines changed Original file line number Diff line number Diff line change @@ -90,14 +90,18 @@ def _write_batch(
9090 if len (record ["MeasureValues" ]) == 0 :
9191 continue
9292 records .append (record )
93- _utils .try_it (
94- f = timestream_client .write_records ,
95- ex = (timestream_client .exceptions .ThrottlingException , timestream_client .exceptions .InternalServerException ),
96- max_num_tries = 5 ,
97- DatabaseName = database ,
98- TableName = table ,
99- Records = records ,
100- )
93+ if len (records ) > 0 :
94+ _utils .try_it (
95+ f = timestream_client .write_records ,
96+ ex = (
97+ timestream_client .exceptions .ThrottlingException ,
98+ timestream_client .exceptions .InternalServerException ,
99+ ),
100+ max_num_tries = 5 ,
101+ DatabaseName = database ,
102+ TableName = table ,
103+ Records = records ,
104+ )
101105 except timestream_client .exceptions .RejectedRecordsException as ex :
102106 return cast (List [Dict [str , str ]], ex .response ["RejectedRecords" ])
103107 return []
You can’t perform that action at this time.
0 commit comments