kunaljubce commented on issue #67643:
URL: https://github.com/apache/airflow/issues/67643#issuecomment-4563849743

   I actually came across this issue while investigating another issue - 
#46293. Tracing the code flow through the 
[KubernetesExecutor.execute_async()](https://github.com/apache/airflow/blob/b66f4433e004fad81b66023bd8caccee55e6e4f7/providers/cncf/kubernetes/src/airflow/providers/cncf/kubernetes/executors/kubernetes_executor.py#L219)
 call down to where the `KubernetesExecutor` param is being fetched from the 
`executor_config` attribute inside 
[PodGenerator.from_obj()](https://github.com/apache/airflow/blob/b66f4433e004fad81b66023bd8caccee55e6e4f7/providers/cncf/kubernetes/src/airflow/providers/cncf/kubernetes/pod_generator.py#L189),
 I found the block as below:
   ```
       def from_obj(obj) -> dict | k8s.V1Pod | None:
           """Convert to pod from obj."""
           if obj is None:
               return None
   
           k8s_legacy_object = obj.get("KubernetesExecutor", None)
           k8s_object = obj.get("pod_override", None)
   
           if k8s_legacy_object and k8s_object:
               raise AirflowConfigException(
                   "Can not have both a legacy and new"
                   "executor_config object. Please delete the 
KubernetesExecutor"
                   "dict and only use the pod_override 
kubernetes.client.models.V1Pod"
                   "object."
               )
           if not k8s_object and not k8s_legacy_object:
               return None
   
           if isinstance(k8s_object, k8s.V1Pod):
               return k8s_object
           raise TypeError(
               "Cannot convert a non-kubernetes.client.models.V1Pod object into 
a KubernetesExecutorConfig"
           )
   ```
   
   As I understand, the `k8s_legacy_object` is storing the value of 
`KubernetesExecutor` param but not doing anything with it. And with 
`k8s_object` being set to `None` due to the absence of the `pod_override` 
param, all conditions are failed and a `TypeError` is raised. This is being 
caught by the `exception` block in `KubernetesExecutor.execute_async()`.


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