Skip to content

Fix BashOperator script detection after templating - #70369

Merged
potiuk merged 1 commit into
apache:mainfrom
fat-catTW:fix-bashoperator-template-init-70296
Jul 30, 2026
Merged

Fix BashOperator script detection after templating#70369
potiuk merged 1 commit into
apache:mainfrom
fat-catTW:fix-bashoperator-template-init-70296

Conversation

@fat-catTW

Copy link
Copy Markdown
Contributor

Fix BashOperator so inline/script command detection runs after bash_command has been templated.

This avoids choosing the wrong execution path when bash_command is a Jinja expression that renders to a .sh or .bash script name.

related: #70296

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

Generated-by: [Codex] following the guidelines


  • 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.

@shahar1 shahar1 removed the backport-to-v3-3-test Backport to v3-3-test label Jul 24, 2026
@fat-catTW
fat-catTW force-pushed the fix-bashoperator-template-init-70296 branch 2 times, most recently from 7bcc585 to 6a4d28a Compare July 24, 2026 12:55

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

Static checks currently fail

@fat-catTW

fat-catTW commented Jul 24, 2026

Copy link
Copy Markdown
Contributor Author

I'll fix it. Thanks for review.

@fat-catTW
fat-catTW force-pushed the fix-bashoperator-template-init-70296 branch 7 times, most recently from 3309f91 to aebda73 Compare July 26, 2026 13:44
@henry3260

Copy link
Copy Markdown
Contributor

Could you resolve conflict?

@fat-catTW

Copy link
Copy Markdown
Contributor Author

Sure

@fat-catTW
fat-catTW force-pushed the fix-bashoperator-template-init-70296 branch 3 times, most recently from 31d8355 to 3f2cf7f Compare July 28, 2026 03:35
@fat-catTW
fat-catTW force-pushed the fix-bashoperator-template-init-70296 branch from 3f2cf7f to 2eb27a5 Compare July 28, 2026 17:18
BashOperator template fields are rendered after construction, so script detection based on the raw constructor argument can choose the wrong execution path for templated commands.
@fat-catTW
fat-catTW force-pushed the fix-bashoperator-template-init-70296 branch from 2eb27a5 to afd4ea3 Compare July 29, 2026 05:56
@fat-catTW

Copy link
Copy Markdown
Contributor Author

Static checks currently fail
Good evening.
PR has passed CI.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants