Skip to content

Commit c610b6f

Browse files
authored
Merge branch 'main' into release-3.0.0
2 parents a18a6fe + 94b076c commit c610b6f

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

awswrangler/timestream.py

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff 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 []

0 commit comments

Comments
 (0)