Skip to content

Commit 1d21e23

Browse files
authored
Publisher fixups (#63)
* one batch * only issue batch if there will be any blobs, fails with "no deferred requests" otherwise
1 parent 7a26660 commit 1d21e23

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

main.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -184,9 +184,11 @@ def load_processed_files_into_bigquery(event, context):
184184
load_job.result()
185185
print(f"Loaded {load_job.output_rows} rows into {DATASET}:{SIMPLE_TABLE}")
186186

187-
with storage_client.batch():
188-
for blob in download_source_blobs:
189-
blob.delete()
190-
with storage_client.batch():
191-
for blob in simple_source_blobs:
192-
blob.delete()
187+
if len(download_source_blobs) > 0:
188+
with storage_client.batch():
189+
for blob in download_source_blobs:
190+
blob.delete()
191+
if len(simple_source_blobs) > 0:
192+
with storage_client.batch():
193+
for blob in simple_source_blobs:
194+
blob.delete()

0 commit comments

Comments
 (0)