Skip to content

Commit

Permalink
fix(airflow-s3): Better logging
Browse files Browse the repository at this point in the history
  • Loading branch information
devsjc committed Nov 20, 2024
1 parent d7ed8ee commit 639c38a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion terraform/modules/services/airflow/dags/utils/s3.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def determine_latest_zarr(bucket: str, prefix: str):
size_old += obj.size

# If the sizes are different, create a new latest.zarr
if size_old != size_new and size_new > 0:
if size_old != size_new and size_new > 500 * 1e3: # Expecting at least 500KB
# Delete the old latest.zarr, if it exists
if prefix + "/latest.zarr/" in prefixes:
s3hook.log.debug(f"Deleting {prefix}/latest.zarr/")
Expand All @@ -40,4 +40,6 @@ def determine_latest_zarr(bucket: str, prefix: str):
dest_bucket_name=bucket,
dest_bucket_key=prefix + "/latest.zarr/" + key.split(zarrs[0])[-1],
)
else:
s3hook.log.info("No changes to latest.zarr required")

0 comments on commit 639c38a

Please sign in to comment.