jscheffl commented on code in PR #47050:
URL: https://github.com/apache/airflow/pull/47050#discussion_r3033496915
##########
providers/cncf/kubernetes/src/airflow/providers/cncf/kubernetes/backcompat/backwards_compat_converters.py:
##########
@@ -41,6 +45,38 @@ def _convert_from_dict(obj, new_class):
raise AirflowException(f"Expected dict or {new_class}, got {type(obj)}")
+def _env_var_dict_to_v1(item: dict[str, Any], idx: int) -> k8s.V1EnvVar:
+ """Build ``V1EnvVar`` from a dict (simple name/value or Kubernetes client
dict)."""
+ name = item.get("name")
+ if isinstance(name, str) and name and "value" in item:
+ return k8s.V1EnvVar(name=name, value=item["value"])
+ if "name" in item and not isinstance(item["name"], str):
+ raise AirflowException(
Review Comment:
There are some more `AirflowException`to be replaced with ValueError.
--
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]