Skip to content

Fix BranchPythonOperator execution failure when callable returns None#54991

Merged
kaxil merged 1 commit intoapache:mainfrom
astronomer:fix-branch-operator-none-return-54340
Aug 27, 2025
Merged

Fix BranchPythonOperator execution failure when callable returns None#54991
kaxil merged 1 commit intoapache:mainfrom
astronomer:fix-branch-operator-none-return-54340

Conversation

@kaxil
Copy link
Copy Markdown
Member

@kaxil kaxil commented Aug 27, 2025

BranchPythonOperator now properly handles callables that return None by skipping all downstream tasks, instead of throwing an execution error. This restores the expected behavior for users who rely on None returns to skip branches conditionally.

Fixes #54340


^ Add meaningful description above
Read the Pull Request Guidelines for more information.
In case of fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in a newsfragment file, named {pr_number}.significant.rst or {issue_number}.significant.rst, in airflow-core/newsfragments.

@kaxil kaxil changed the title Fix BranchPythonOperator execution failure when callable returns … Fix BranchPythonOperator execution failure when callable returns None Aug 27, 2025
@kaxil kaxil force-pushed the fix-branch-operator-none-return-54340 branch from bd71f32 to 3e13057 Compare August 27, 2025 18:14
`BranchPythonOperator` now properly handles callables that return None
by skipping all downstream tasks, instead of throwing an execution error.
This restores the expected behavior for users who rely on None returns
to skip branches conditionally.

Fixes apache#54340
@kaxil kaxil force-pushed the fix-branch-operator-none-return-54340 branch from 3e13057 to 64082f2 Compare August 27, 2025 18:15
@kaxil kaxil requested review from eladkal and gopidesupavan August 27, 2025 18:15
@kaxil kaxil merged commit 0ef0a6b into apache:main Aug 27, 2025
103 checks passed
@kaxil kaxil deleted the fix-branch-operator-none-return-54340 branch August 27, 2025 18:56
Copy link
Copy Markdown
Contributor

@amoghrajesh amoghrajesh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, looks good!

mangal-vairalkar pushed a commit to mangal-vairalkar/airflow that referenced this pull request Aug 30, 2025
…he#54991)

`BranchPythonOperator` now properly handles callables that return None
by skipping all downstream tasks, instead of throwing an execution error.
This restores the expected behavior for users who rely on None returns
to skip branches conditionally.

Fixes apache#54340
nothingmin pushed a commit to nothingmin/airflow that referenced this pull request Sep 2, 2025
…he#54991)

`BranchPythonOperator` now properly handles callables that return None
by skipping all downstream tasks, instead of throwing an execution error.
This restores the expected behavior for users who rely on None returns
to skip branches conditionally.

Fixes apache#54340
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.

Branching is broken when callable function returns None or falsy value

3 participants