GitHub user kacpermuda added a comment to the discussion: TypeError when 
importing operators from airflow.providers.google.cloud.operators.dataproc

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 
`airflow.providers.common.compat.openlineage.facet`. We implemented it as a 
no-op **function**, so when we try to base **class** on it, we get the above 
error. It came out in latest google provider as this is the first time, where 
we are adding some OL-related feature that is NOT contained to 
`get_openlineage_facets_on_...` methods (where we are sure the OL is 
accessible). I'll provide a fix PR shortly, so that we can release it in the 
next google provider version.

@iscipar For now the only quick fix i can think of is installing the latest 
version of `apache-airflow-providers-openlineage` package together with your 
google provider. This way the RunFacet class will be available and import will 
not fail. Also, if you don't want to use OpenLineage make sure to [disable 
it](https://airflow.apache.org/docs/apache-airflow-providers-openlineage/stable/configurations-ref.html#disabled)
 f.e. by setting env variable `AIRFLOW__OPENLINEAGE__DISABLED=True`. This way, 
there will be no influence on your code, no additional actions from the 
OpenLineage provider, and the imports should not fail. Sorry for the trouble, 
let me know if it fixed the problem.



GitHub link: 
https://github.com/apache/airflow/discussions/46478#discussioncomment-12093283

----
This is an automatically sent email for [email protected].
To unsubscribe, please send an email to: [email protected]

Reply via email to