astronomer / dag-factory

Dynamically generate Apache Airflow DAGs from YAML configuration files
Apache License 2.0
1.21k stars 181 forks source link

[Bug] Import error using latest Airflow Kubernetes provider package #288

Open Orpheuz opened 3 days ago

Orpheuz commented 3 days ago

DAG Factory version

0.20.0

airflow version

2.8.1

Python version

3.11

Deployment

Docker-Compose

What happened?

The newly released version of apache-airflow-providers-cncf-kubernetes includes the deprecation of airflow.providers.cncf.kubernetes.operators.kubernetes_pod which ultimately throws an exception in dagbuilder.py imports:

Relevant log output

Broken DAG: [/usr/local/airflow/dags/dag_generator.py] Traceback (most recent call last):
  File "/usr/local/airflow/.local/lib/python3.11/site-packages/dagfactory/dagbuilder.py", line 66, in <module>
    from airflow.providers.cncf.kubernetes.operators.kubernetes_pod import KubernetesPodOperator
ModuleNotFoundError: No module named 'airflow.providers.cncf.kubernetes.operators.kubernetes_pod'

How to reproduce

Run dag-factory (0.20.0) with the latest kubernetes Airflow provider

Are you willing to submit PR?

pankajastro commented 3 days ago

Could you please set apache-airflow-providers-cncf-kubernetes<10.0.0 as a dependency in your project? kubernetes_pod has been removed in apache-airflow-providers-cncf-kubernetes version 10.0.0 see changelog https://airflow.apache.org/docs/apache-airflow-providers-cncf-kubernetes/stable/changelog.html#id1

Orpheuz commented 3 days ago

Yes, I added that as a workaround