kaxil commented on code in PR #56733:
URL: https://github.com/apache/airflow/pull/56733#discussion_r2436941276


##########
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:
   The `force=True` alone will be enough without any changes. I had pushed a 
fix on your PR :) before your force-pushed it too :) 



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

Reply via email to