Fix zipped DAG template loading with safe path handling#60999
Fix zipped DAG template loading with safe path handling#60999soooojinlee wants to merge 1 commit intoapache:mainfrom
Conversation
|
Congratulations on your first Pull Request and welcome to the Apache Airflow community! If you have any issues or are unsure about any anything please check our Contributors' Guide (https://github.com/apache/airflow/blob/main/contributing-docs/README.rst)
|
872e812 to
e8e3fba
Compare
SameerMesiah97
left a comment
There was a problem hiding this comment.
I have left a few comments.
kalluripradeep
left a comment
There was a problem hiding this comment.
Thanks for tackling this issue! The zip-aware loader is a good solution to #59310.
I agree with @SameerMesiah97's feedback:
-
Removing the operator-level override check - This does seem like it could be a breaking change. Could you clarify why this was removed or restore it if it was unintentional?
-
Docstring length - The suggested shorter version would be clearer for IDE tooltips while keeping the details in comments.
Additional observations:
The test coverage looks comprehensive with mixed paths, ordering, and traversal blocking. Good work on the security aspect (path traversal prevention).
One question: Have you tested this with real-world zipped DAGs to ensure backward compatibility with existing deployments?
Looking forward to the updates! 👍
- Restore _should_render_native method that was unintentionally removed - Update _render to use _should_render_native for operator-level render_template_as_native_obj override support - Simplify ZipAwareFileSystemLoader docstring per reviewer suggestion - Move implementation details and issue reference to code comments - Use Python naming convention 'up_to_date' instead of 'uptodate'
c3cfe34 to
06e5ec8
Compare
276d69c to
dba2c2e
Compare
- Restore _should_render_native method that was unintentionally removed - Update _render to use _should_render_native for operator-level render_template_as_native_obj override support - Simplify ZipAwareFileSystemLoader docstring per reviewer suggestion - Move implementation details and issue reference to code comments - Use Python naming convention 'up_to_date' instead of 'uptodate'
providers/edge3/src/airflow/providers/edge3/worker_api/v2-edge-generated.yaml
Show resolved
Hide resolved
|
@soooojinlee This PR has a few issues that need to be addressed before it can be reviewed — please see our Pull Request quality criteria. Issues found:
What to do next:
Please address the issues above and push again. If you have questions, feel free to ask on the Airflow Slack. |
df5a5b5 to
8ffb7c6
Compare
- Restore _should_render_native method that was unintentionally removed - Update _render to use _should_render_native for operator-level render_template_as_native_obj override support - Simplify ZipAwareFileSystemLoader docstring per reviewer suggestion - Move implementation details and issue reference to code comments - Use Python naming convention 'up_to_date' instead of 'uptodate'
8ffb7c6 to
9237dc8
Compare
- Restore _should_render_native method that was unintentionally removed - Update _render to use _should_render_native for operator-level render_template_as_native_obj override support - Simplify ZipAwareFileSystemLoader docstring per reviewer suggestion - Move implementation details and issue reference to code comments - Use Python naming convention 'up_to_date' instead of 'uptodate'
Rebased the PR changes onto the latest upstream/main, resolving conflicts in templater.py imports (merged zip-support imports with upstream's Iterator addition). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
d0ca89d to
2b00d57
Compare

Switch DAG templating to a zip-aware loader that preserves searchpath order and applies the same path traversal rules as FileSystemLoader. Add tests for mixed paths, ordering, and zip traversal blocking.
Summary
Test plan
Docs
Breaking changes
Related
Was generative AI tooling used to co-author this PR?
Generated-by: Claude Opus 4.5
{pr_number}.significant.rstor{issue_number}.significant.rst, in airflow-core/newsfragments.