This is an automated email from the ASF dual-hosted git repository.

husseinawala pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git


The following commit(s) were added to refs/heads/main by this push:
     new de71a62848 fix: KPO typing env_vars (#36048)
de71a62848 is described below

commit de71a62848bd91e56bdc675246ab51bc6affa629
Author: raphaelauv <[email protected]>
AuthorDate: Tue Dec 5 09:07:18 2023 +0100

    fix: KPO typing env_vars (#36048)
---
 .../providers/cncf/kubernetes/backcompat/backwards_compat_converters.py | 2 +-
 airflow/providers/cncf/kubernetes/operators/pod.py                      | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git 
a/airflow/providers/cncf/kubernetes/backcompat/backwards_compat_converters.py 
b/airflow/providers/cncf/kubernetes/backcompat/backwards_compat_converters.py
index bb1e49ecbb..4fcb9e45ae 100644
--- 
a/airflow/providers/cncf/kubernetes/backcompat/backwards_compat_converters.py
+++ 
b/airflow/providers/cncf/kubernetes/backcompat/backwards_compat_converters.py
@@ -69,7 +69,7 @@ def convert_port(port) -> k8s.V1ContainerPort:
     return _convert_kube_model_object(port, k8s.V1ContainerPort)
 
 
-def convert_env_vars(env_vars) -> list[k8s.V1EnvVar]:
+def convert_env_vars(env_vars: list[k8s.V1EnvVar] | dict[str, str]) -> 
list[k8s.V1EnvVar]:
     """
     Convert a dictionary into a list of env_vars.
 
diff --git a/airflow/providers/cncf/kubernetes/operators/pod.py 
b/airflow/providers/cncf/kubernetes/operators/pod.py
index 3cacb126d0..b3c10d4ff1 100644
--- a/airflow/providers/cncf/kubernetes/operators/pod.py
+++ b/airflow/providers/cncf/kubernetes/operators/pod.py
@@ -288,7 +288,7 @@ class KubernetesPodOperator(BaseOperator):
         ports: list[k8s.V1ContainerPort] | None = None,
         volume_mounts: list[k8s.V1VolumeMount] | None = None,
         volumes: list[k8s.V1Volume] | None = None,
-        env_vars: list[k8s.V1EnvVar] | None = None,
+        env_vars: list[k8s.V1EnvVar] | dict[str, str] | None = None,
         env_from: list[k8s.V1EnvFromSource] | None = None,
         secrets: list[Secret] | None = None,
         in_cluster: bool | None = None,

Reply via email to