mjpieters commented on issue #11556:
URL: https://github.com/apache/airflow/issues/11556#issuecomment-709505389


   I fear there are a few more issues in this area.
   
   The problems lie primarily in two sections of 
`airflow/serialization/serialized_objects.py`:
   
   
https://github.com/apache/airflow/blob/4551a5e6d56ef4c141aa2ef0f7df20bbf2b09800/airflow/serialization/serialized_objects.py#L29-L37
   
   This code guards against the import error when `kubernetes` is not 
installed, but a few lines down then imports 
`airflow.kubernetes.pod_generator`, which really can't avoid having to import 
`kubernetes`.
   
   Further down, there are other issues that will break if the above 
`airflow.kubernetes.pod_generator` import is moved into the `ImportError` guard:
   
   
https://github.com/apache/airflow/blob/4551a5e6d56ef4c141aa2ef0f7df20bbf2b09800/airflow/serialization/serialized_objects.py#L190-L197
   
   If `k8s` can be set to `None`, then referencing `k8s.V1Pod` will raise an 
`AttributeError`.


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to