Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix compatibility with apache-airflow-providers-cncf-kubernetes>=10.0…
….0 (#311) Users were not able to use DAG Factory with apache-airflow-providers-cncf-kubernetes>=10.0.0, which was [released](https://pypi.org/project/apache-airflow-providers-cncf-kubernetes/#history) on 18 November 2024. When attempting to install a local dev environment using: ``` python3.10 -m venv venv source venv/bin/activate pip install '.[tests]' ``` If we attempted to run: ``` ln -s dev/dags dags AIRFLOW_HOME=`pwd` airflow dags list-import-errors ``` All DAG factory example DAGs would error with messages like: ``` filepath | error ===============================================================+============================================================== /Users/tati/Code/dag-factory/dags/example_da | Traceback (most recent call last): g_factory.py | File | "/Users/tati/Code/dag-factory/dagfactory/da | gbuilder.py", line 69, in <module> | from | airflow.providers.cncf.kubernetes.operators.kubernetes_pod | import KubernetesPodOperator | ModuleNotFoundError: No module named | 'airflow.providers.cncf.kubernetes.operators.kubernetes_pod' | | During handling of the above exception, another exception | occurred: | | Traceback (most recent call last): | File | "/Users/tati/Code/dag-factory/dagfactory/da | gfactory.py", line 13, in <module> | from dagfactory.dagbuilder import DagBuilder | File | "/Users/tati/Code/dag-factory/dagfactory/da | gbuilder.py", line 71, in <module> | from airflow.contrib.kubernetes.pod import Port | ModuleNotFoundError: No module named | 'airflow.contrib.kubernetes' | /Users/tati/Code/dag-factory/dags/example_ta | Traceback (most recent call last): sk_group.py | File | "/Users/tati/Code/dag-factory/dagfactory/da | gbuilder.py", line 69, in <module> | from | airflow.providers.cncf.kubernetes.operators.kubernetes_pod | import KubernetesPodOperator | ModuleNotFoundError: No module named | 'airflow.providers.cncf.kubernetes.operators.kubernetes_pod' | | During handling of the above exception, another exception | occurred: | | Traceback (most recent call last): | File | "/Users/tati/Code/dag-factory/dagfactory/da | gfactory.py", line 13, in <module> | from dagfactory.dagbuilder import DagBuilder | File | "/Users/tati/Code/dag-factory/dagfactory/da | gbuilder.py", line 71, in <module> | from airflow.contrib.kubernetes.pod import Port | ModuleNotFoundError: No module named | 'airflow.contrib.kubernetes' ``` This was due to a breaking change introduced in `apache-airflow-providers-cncf-kubernetes` 10: https://airflow.apache.org/docs/apache-airflow-providers-cncf-kubernetes/stable/changelog.html > Remove airflow.providers.cncf.kubernetes.operators.kubernetes_pod. Use airflow.providers.cncf.kubernetes.operators.pod instead.
- Loading branch information