Skip to content

Skip S3 folder-marker keys in S3ToGCSOperator - #65724

Merged
shahar1 merged 2 commits into
apache:mainfrom
yuseok89:fix/s3-to-gcs-skip-directory-markers
May 12, 2026
Merged

shahar1 merged 2 commits into
apache:mainfrom
yuseok89:fix/s3-to-gcs-skip-directory-markers

Conversation

@yuseok89

Copy link
Copy Markdown
Contributor

S3ToGCSOperator now drops S3 keys that end with /.

Problem

  1. Listing objects for a given bucket and prefix (e.g. folder_name/) can return trailing-/ keys. Previously they were included in execute's return value and XCom (gs://…/folder_name/).
  2. With deferrable=True, that list is sent to Storage Transfer as includePrefixes. A key like folder_name/ is a strict prefix of keys such as folder_name/file.txt, which the API rejects with HTTP 400 (overlapping include prefixes).

Solution

  • Omit keys ending with / from the list used for transfer and for execute.
  • This matches typical S3 folder placeholders; ordinary data object keys rarely end with /.

Screenshots

Before

Trailing / in XCom
image

Deferrable / Storage Transfer includePrefixes error
image

After

No trailing / in XCom
image

Deferrable run succeeds
image


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

  • 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:google Google (including GCP) related issues labels Apr 23, 2026
@yuseok89
yuseok89 marked this pull request as ready for review April 23, 2026 22:55
@yuseok89
yuseok89 requested a review from shahar1 as a code owner April 23, 2026 22:55
@potiuk potiuk added the ready for maintainer review Set by triage when all criteria pass, or by the fork CI reconciler when fork CI is green. label Apr 27, 2026
@shahar1 shahar1 changed the title fix: skip S3 folder-marker keys in S3ToGCSOperator Skip S3 folder-marker keys in S3ToGCSOperator May 12, 2026
@shahar1
shahar1 merged commit c60edf7 into apache:main May 12, 2026
95 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:providers provider:google Google (including GCP) related issues ready for maintainer review Set by triage when all criteria pass, or by the fork CI reconciler when fork CI is green.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants