Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(airflow-s3): Better logging #692

Merged
merged 2 commits into from
Nov 20, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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")