Skip to content

Fix S3KeySensor metadata dict#1

Draft
tuzonghua wants to merge 4 commits intomainfrom
amazon/fix-s3keysensor-metadata-dict
Draft

Fix S3KeySensor metadata dict#1
tuzonghua wants to merge 4 commits intomainfrom
amazon/fix-s3keysensor-metadata-dict

Conversation

@tuzonghua
Copy link
Owner

Closes apache#44896. Prior work had added "Key" to the S3KeySensor metadata_keys default value but didn't correctly set the value in the files list provided to check_fn. This sets the value correctly as well as updates outdated documentation to reflect the change.


Was generative AI tooling used to co-author this PR?
  • Yes (please specify the tool below)

  • Read the Pull Request Guidelines for more information. Note: commit author/co-author name and email in commits become permanently public when merged.
  • For fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
  • When adding dependency, check compliance with the ASF 3rd Party License Policy.
  • For significant user-facing changes create newsfragment: {pr_number}.significant.rst or {issue_number}.significant.rst, in airflow-core/newsfragments.

When a check_fn is specified in a S3KeySensor, the S3 key itself
should be available in each element of the `files` list to better
associate given metadata with the key. This adds a key `"Key": str`
to the metadata dictionary for each S3 key.
The `metadata_keys` list had `["Size", "Key"]` as a default value
to mirror the default from S3KeySensor, but was unnecessary since
it got overwritten with the S3 key.
@tuzonghua tuzonghua force-pushed the amazon/fix-s3keysensor-metadata-dict branch from 7a87351 to 0f35873 Compare February 24, 2026 18:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow check_fn of S3KeySensor to receive bucket key

1 participant