kaxil opened a new pull request, #57023:
URL: https://github.com/apache/airflow/pull/57023
Replace version-specific conditional imports with common.compat layer.
This PR migrates the cncf/kubernetes provider to use the centralized
common.compat compatibility layer instead of local version_compat.py patterns.
## Changes
- Added `apache-airflow-providers-common-compat>=1.7.4` dependency
- Migrated imports in 5 source files:
- `hooks/kubernetes.py`: BaseHook
- `sensors/spark_kubernetes.py`: BaseSensorOperator
- `decorators/kubernetes.py`: DecoratedOperator, TaskDecorator,
task_decorator_factory
- `decorators/kubernetes_cmd.py`: DecoratedOperator, TaskDecorator,
context_merge, task_decorator_factory
- `operators/pod.py`: XCOM_RETURN_KEY
- Updated `version_compat.py` to keep only version constants
- Kept AIRFLOW_V_3_1_PLUS conditional for BaseOperator imports in operators
(special case for DecoratedOperator compatibility)
## Verification
All automated checks passed:
- ✅ No class imports from version_compat remain
- ✅ Common.compat imports present (5 imports)
- ✅ No conditional import blocks remain
- ✅ pyproject.toml updated correctly
- ✅ Pre-commit hooks passed
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]