kaxil commented on code in PR #56733:
URL: https://github.com/apache/airflow/pull/56733#discussion_r2436897126
##########
airflow-core/src/airflow/serialization/serialized_objects.py:
##########
@@ -925,8 +925,11 @@ def deserialize(cls, encoded_var: Any) -> Any:
elif type_ == DAT.DATETIME:
return from_timestamp(var)
elif type_ == DAT.POD:
- if not _has_kubernetes():
- raise RuntimeError("Cannot deserialize POD objects without
kubernetes libraries installed!")
+ # lazy import PogGenerator here if needed and set HAS_KUBERNETES
to True and import the generator
+ # because if we need to deserialize Pod, we MUST have PodGenerator
imported
+ _has_kubernetes(force=True)
+ from airflow.providers.cncf.kubernetes.pod_generator import
PodGenerator
+
Review Comment:
@potiuk This is a wrong fix! and will result in Scheduler or API-server
crashing if k8s library was uninstalled/not-present anymore with weird errors
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]