Skip to content

Make ZIP_REGEX case-insensitive to match .ZIP archives - #74269

Merged
vatsrahul1001 merged 3 commits into
apache:mainfrom
Subham-KRLX:fix/zip-regex-case-insensitive
Oct 18, 2026
Merged

vatsrahul1001 merged 3 commits into
apache:mainfrom
Subham-KRLX:fix/zip-regex-case-insensitive

Conversation

@Subham-KRLX

Copy link
Copy Markdown
Contributor

Dag discovery accepts packaged Dags ending in .ZIP, but ZIP_REGEX in airflow/utils/file.py only matched lowercase .zip. As a result, correct_maybe_zipped and open_maybe_zipped failed to treat .ZIP archives as zip files, causing DagCode to raise NotADirectoryError when reading back the Dag source.

This PR adds re.IGNORECASE to ZIP_REGEX and adds unit tests covering uppercase .ZIP archives for both correct_maybe_zipped and open_maybe_zipped.

closes: #74060


Was generative AI tooling used to co-author this PR?
  • Yes (Claude Code for code research and PR description)

@eladkal
eladkal requested a review from jason810496 October 5, 2026 15:23
@eladkal eladkal added this to the Airflow 3.4.0 milestone Oct 5, 2026
@eladkal eladkal added the type:bug-fix Changelog: Bug Fixes label Oct 5, 2026

@rjgoyln rjgoyln 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.

Overall LGTM. I left two small notes below, both on the new tests.

Just some thoughts from my side — please feel free to resolve them if they’re not applicable.

Comment thread airflow-core/tests/unit/utils/test_file.py Outdated
Comment thread airflow-core/tests/unit/utils/test_file.py Outdated

@rjgoyln rjgoyln 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.

looks great!

@vatsrahul1001
vatsrahul1001 merged commit b59f748 into apache:main Oct 18, 2026
79 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

Backport successfully created: v3-4-test

Note: As of Merging PRs targeted for Airflow 3.X
the committer who merges the PR is responsible for backporting the PRs that are bug fixes (generally speaking) to the maintenance branches.

In matter of doubt please ask in #release-management Slack channel.

Status Branch Result
✅ v3-4-test PR Link

vatsrahul1001 pushed a commit that referenced this pull request Oct 18, 2026
…74269) (#74967)

* Make ZIP_REGEX case-insensitive to match .ZIP archives

closes: #74060

* Simplify and parameterize uppercase ZIP tests
(cherry picked from commit b59f748)

Co-authored-by: Subham <subhamsangwan26@gmail.com>
vatsrahul1001 pushed a commit that referenced this pull request Oct 20, 2026
…74269) (#74967)

* Make ZIP_REGEX case-insensitive to match .ZIP archives

closes: #74060

* Simplify and parameterize uppercase ZIP tests
(cherry picked from commit b59f748)

Co-authored-by: Subham <subhamsangwan26@gmail.com>
SameerMesiah97 pushed a commit to SameerMesiah97/airflow-oss-sm97 that referenced this pull request Oct 27, 2026
* Make ZIP_REGEX case-insensitive to match .ZIP archives

closes: apache#74060

* Simplify and parameterize uppercase ZIP tests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type:bug-fix Changelog: Bug Fixes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

A packaged Dag named *.ZIP cannot be read back

4 participants