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 @@ -81,14 +81,18 @@ def _write_batch(
8181 if len (record ["MeasureValues" ]) == 0 :
8282 continue
8383 records .append (record )
84- _utils .try_it (
85- f = timestream_client .write_records ,
86- ex = (timestream_client .exceptions .ThrottlingException , timestream_client .exceptions .InternalServerException ),
87- max_num_tries = 5 ,
88- DatabaseName = database ,
89- TableName = table ,
90- Records = records ,
91- )
84+ if len (records ) > 0 :
85+ _utils .try_it (
86+ f = timestream_client .write_records ,
87+ ex = (
88+ timestream_client .exceptions .ThrottlingException ,
89+ timestream_client .exceptions .InternalServerException ,
90+ ),
91+ max_num_tries = 5 ,
92+ DatabaseName = database ,
93+ TableName = table ,
94+ Records = records ,
95+ )
9296 except timestream_client .exceptions .RejectedRecordsException as ex :
9397 return cast (List [Dict [str , str ]], ex .response ["RejectedRecords" ])
9498 return []
You can’t perform that action at this time.
0 commit comments