The GitHub Actions job "Tests AMD" on airflow.git/fix-circular-import-ke has 
failed.
Run started by GitHub user kaxil (triggered by kaxil).

Head commit for run:
48cb640ec3249fa1056c291a2f3de12aa6977649 / Kaxil Naik <[email protected]>
Fix circular import in CNCF Kubernetes provider version_compat

Resolves circular import that occurs when KubernetesExecutor is dynamically 
loaded during Airflow startup. The issue manifests as 'cannot import name from 
partially initialized module' errors during scheduler/triggerer initialization.

Root cause: The import chain executor → version_compat → BaseOperator → 
taskinstance → sentry → executor creates a circular dependency when sentry is 
enabled, as sentry initialization attempts to load the executor while it's 
already being imported.

Changes:
- Remove BaseOperator and BaseSensorOperator from version_compat.py 
module-level imports
- Add conditional imports directly in operator/sensor files that need these 
classes
- Maintain compatibility across Airflow 2.x and 3.x versions

This prevents the circular import by breaking the chain at version_compat, 
ensuring sentry initialization doesn't trigger recursive executor loading.

Files affected:
- version_compat.py: Removed BaseOperator/BaseSensorOperator imports
- operators/job.py: Added conditional BaseOperator import
- operators/kueue.py: Added conditional BaseOperator import
- operators/pod.py: Added conditional BaseOperator import
- operators/resource.py: Added conditional BaseOperator import
- sensors/spark_kubernetes.py: Added conditional BaseSensorOperator import

Fixes #55803

Report URL: https://github.com/apache/airflow/actions/runs/17813110956

With regards,
GitHub Actions via GitBox


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to