Skip to content

Conversation

@kaxil
Copy link
Member

@kaxil kaxil commented Aug 22, 2025

Resolves issue where @task.external_python with expect_airflow=False would throw exceptions in Airflow 3.0.4+ when Airflow was not installed in the target environment, breaking functionality that worked in Airflow 2.9.1.

The ExternalPythonOperator now respects the expect_airflow flag and skips Airflow version checking when expect_airflow=False, preventing exceptions and allowing tasks to run successfully in environments without Airflow.

Closes #54766


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

Resolves issue where `@task.external_python` with `expect_airflow=False` would throw
exceptions in Airflow 3.0.4+ when Airflow was not installed in the target
environment, breaking functionality that worked in Airflow 2.9.1.

The `ExternalPythonOperator` now respects the `expect_airflow` flag and skips
Airflow version checking when `expect_airflow=False, preventing exceptions
and allowing tasks to run successfully in environments without Airflow.

Closes apache#54766
@kaxil kaxil requested review from eladkal and hussein-awala August 22, 2025 00:42
@kaxil kaxil changed the title Fix external_python task failure when expect_airflow=False Fix external_python task failure when expect_airflow=False Aug 22, 2025
@hussein-awala hussein-awala merged commit 27ce761 into apache:main Aug 22, 2025
107 checks passed
mangal-vairalkar pushed a commit to mangal-vairalkar/airflow that referenced this pull request Aug 30, 2025
@kaxil kaxil deleted the fix-external-python-expect-airflow-false branch December 31, 2025 02:21
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.

external_python task throws exception in Airflow 3.0.4 when expect_airflow=False

3 participants