dstandish commented on code in PR #24716:
URL: https://github.com/apache/airflow/pull/24716#discussion_r908918711
##########
airflow/providers/cncf/kubernetes/hooks/kubernetes.py:
##########
@@ -363,11 +363,9 @@ def get_custom_object(
def get_namespace(self) -> Optional[str]:
"""Returns the namespace that defined in the connection"""
if self.conn_id:
- connection = self.get_connection(self.conn_id)
- extras = connection.extra_dejson
- namespace = extras.get("extra__kubernetes__namespace", "default")
- return namespace
- return None
+ return self._get_field('namespace', 'default')
Review Comment:
this is just an optimization since it uses cached prop `conn_extras` whereas
`get_namespace` retrieves the conn in every 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]