Skip to content

Skip Azure Blob folder-marker keys in AzureBlobStorageToS3Operator - #72892

Merged
o-nikolas merged 4 commits into
apache:mainfrom
yuseok89:skip-folder-markers-in-azure-blob-to-s3
Sep 24, 2026
Merged

o-nikolas merged 4 commits into
apache:mainfrom
yuseok89:skip-folder-markers-in-azure-blob-to-s3

Conversation

@yuseok89

@yuseok89 yuseok89 commented Sep 10, 2026 •

Copy link
Copy Markdown
Contributor

AzureBlobStorageToS3Operator copies every name WasbHook.get_blobs_list_recursive() returns, including the trailing-/ folder markers a container listing contains. They land in S3 as spurious empty keys and in the XCom output.

This applies the same overlap-aware rule introduced for GCSToS3Operator in #72497. The filtering logic is now shared by both operators through an Amazon transfer utility: a trailing-/ key is dropped only when it is also a strict prefix of another key in the same listing, so a real object like lonely/ is kept. The filter runs right after the listing, so the upload, the replace=False comparison, and the XCom output all see the same list.

Skipped keys are logged, and the returned list is now sorted and de-duplicated.

Before / After

Listing: src/ (a marker), src/file.txt, and lonely/ (a real object whose name ends in /).

S3 keys XCom
Before src/, src/file.txt, lonely/ all three
After src/file.txt, lonely/ those two

Verified end to end against a real Azure storage account and a real S3 bucket, with the markers created through the Blob API.


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

  • 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, in airflow-core/newsfragments. You can add this file in a follow-up commit after the PR is created so you know the PR number.

@boring-cyborg boring-cyborg Bot added area:providers provider:amazon AWS/Amazon - related issues labels Sep 10, 2026
@yuseok89
yuseok89 marked this pull request as ready for review September 11, 2026 12:37
@yuseok89
yuseok89 requested a review from o-nikolas as a code owner September 11, 2026 12:37

@o-nikolas o-nikolas left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left a couple comments, otherwise looks good to me

Comment thread providers/amazon/src/airflow/providers/amazon/aws/transfers/azure_blob_to_s3.py Outdated
Comment thread providers/amazon/src/airflow/providers/amazon/aws/transfers/azure_blob_to_s3.py Outdated
@yuseok89
yuseok89 force-pushed the skip-folder-markers-in-azure-blob-to-s3 branch from 7268882 to 6c810bf Compare September 17, 2026 00:19
@yuseok89
yuseok89 requested a review from o-nikolas September 17, 2026 00:28
@yuseok89
yuseok89 force-pushed the skip-folder-markers-in-azure-blob-to-s3 branch from 6c810bf to 27d2972 Compare September 17, 2026 02:20
@o-nikolas
o-nikolas merged commit fb959c7 into apache:main Sep 24, 2026
83 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:providers provider:amazon AWS/Amazon - related issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants