dimberman commented on a change in pull request #10756:
URL: https://github.com/apache/airflow/pull/10756#discussion_r484512936
##########
File path: airflow/kubernetes/pod_generator.py
##########
@@ -324,47 +325,36 @@ def add_sidecar(pod: k8s.V1Pod) -> k8s.V1Pod:
@staticmethod
def from_obj(obj) -> Optional[k8s.V1Pod]:
"""Converts to pod from obj"""
+
if obj is None:
return None
- if isinstance(obj, PodGenerator):
- return obj.gen_pod()
-
- if not isinstance(obj, dict):
- raise TypeError(
- 'Cannot convert a non-dictionary or non-PodGenerator '
- 'object into a KubernetesExecutorConfig')
+ k8s_legacy_object = obj.get("KubernetesExecutor", None)
+ k8s_object = obj.get("podOverride", None)
Review comment:
@kaxil sure, I was trying to keep in line with the original key
"KubernetesExecutor", but I'm fine with that to be more consistent with
pythonic best practices.
----------------------------------------------------------------
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]