kaxil commented on code in PR #28230:
URL: https://github.com/apache/airflow/pull/28230#discussion_r1054890030
##########
airflow/providers/cncf/kubernetes/hooks/kubernetes.py:
##########
@@ -406,3 +418,83 @@ def _get_bool(val) -> bool | None:
elif val.strip().lower() == "false":
return False
return None
+
+
+class AsyncKubernetesHook(KubernetesHook):
+ """Hook to use Kubernetes SDK asynchronously."""
+
+ def __init__(self, config_dict: dict | None = None, *args, **kwargs):
+ super().__init__(*args, **kwargs)
+ self.config_dict = config_dict
+
+ async def _load_config(self):
+ """Returns Kubernetes API session for use with requests"""
+ in_cluster = self._coalesce_param(self.in_cluster,
self._get_field("in_cluster"))
+ cluster_context = self._coalesce_param(self.cluster_context,
self._get_field("cluster_context"))
Review Comment:
`self._get_field` calls `self.conn_extras` which has a DB call.
Can you override it please so that we can make it an async call
--
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]