Skip to content

Fix BashOperator script detection after templating#70369

Open
fat-catTW wants to merge 1 commit into
apache:mainfrom
fat-catTW:fix-bashoperator-template-init-70296
Open

Fix BashOperator script detection after templating#70369
fat-catTW wants to merge 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.

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

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.

2 participants