Replies: 8 comments 7 replies
-
Thanks for opening your first issue here! Be sure to follow the issue template! If you are willing to raise PR to address this issue please do so, no need to wait for approval. |
Beta Was this translation helpful? Give feedback.
-
I think that Airflow's Google provider package is using code that is incompatible with Python 3.12. This is likely due to changes in Python 3.12 affecting the exec() function or types.CodeType |
Beta Was this translation helpful? Give feedback.
-
Hi.
|
Beta Was this translation helpful? Give feedback.
-
I think you mighthave old version of dependencies. Please use latest constraints for 2.10.4 to check if you upgraded to the correct versions of deps - especially openlineage provider |
Beta Was this translation helpful? Give feedback.
-
Converted to a discusison but maybe @kacpermuda or @mobuchowski might help if you continue to have problems after updating . |
Beta Was this translation helpful? Give feedback.
-
I think this one is on me, does not relate to python version used and is most likely related to putting the import in the top level code in the dataproc module. Even though it's using compat provider underneath, I think there is a problem with how we implemented the NoOp in @iscipar For now the only quick fix i can think of is installing the latest version of |
Beta Was this translation helpful? Give feedback.
-
PR #46561 should fix this. |
Beta Was this translation helpful? Give feedback.
-
Dm @Traviscal |
Beta Was this translation helpful? Give feedback.
-
Apache Airflow Provider(s)
google
Versions of Apache Airflow Providers
12.0.0
Apache Airflow version
2.10.4
Operating System
Ubuntu 24.04.1 LTS
Deployment
Virtualenv installation
Deployment details
No response
What happened
When importing any of the existing operators in airflow.providers.google.cloud.operators.dataproc (for example DataprocCreateClusterOperator, DataprocDeleteClusterOperator or DataprocSubmitJobOperator) at the beginning of a dag, a dag import error occurs when starting the airflow scheduler.
What you think should happen instead
When I start the airflow scheduler the following error occurs:
[2025-02-02T19:12:46.029+0100] {logging_mixin.py:190} INFO - [2025-02-02T19:12:46.028+0100] {dagbag.py:387} ERROR - Failed to import: /home/iscipar/Projects/airflow-tutorial/dags/6_dataproc_airflow.py
Traceback (most recent call last):
File "/home/iscipar/Proyectos/airflow-tutorial/airflow_env/lib/python3.12/site-packages/airflow/models/dagbag.py", line 383, in parse
loader.exec_module(new_module)
File "", line 995, in exec_module
File "", line 488, in _call_with_frames_removed
File "/home/iscipar/Proyectos/airflow-tutorial/dags/6_dataproc_airflow.py", line 5, in
from airflow.providers.google.cloud.operators.dataproc import (
File "/home/iscipar/Proyectos/airflow-tutorial/airflow_env/lib/python3.12/site-packages/airflow/providers/google/cloud/operators/dataproc.py", line 57, in
from airflow.providers.google.cloud.openlineage.utils import (
File "/home/iscipar/Proyectos/airflow-tutorial/airflow_env/lib/python3.12/site-packages/airflow/providers/google/cloud/openlineage/utils.py", line 204, in
class BigQueryJobRunFacet(RunFacet):
TypeError: function() argument 'code' must be code, not str
How to reproduce
The error is reproduced simply by adding the following import inside the code of a dag without importing the source code of the tasks of said dag:
Anything else
No response
Are you willing to submit PR?
Code of Conduct
Beta Was this translation helpful? Give feedback.
All reactions