dstandish commented on code in PR #27202:
URL: https://github.com/apache/airflow/pull/27202#discussion_r1006178099


##########
airflow/providers/cncf/kubernetes/hooks/kubernetes.py:
##########
@@ -319,9 +319,32 @@ def get_custom_object(
             raise AirflowException(f"Exception when calling -> 
get_custom_object: {e}\n")
 
     def get_namespace(self) -> str | None:
-        """Returns the namespace that defined in the connection"""
+        """
+        Returns the namespace defined in the connection or 'default'.
+
+        TODO: in provider version 6.0, return None when namespace not defined 
in connection
+        """
+        namespace = self._get_namespace()
+        if self.conn_id and not namespace:
+            warnings.warn(
+                "Airflow connection defined but namespace is not set; 
'default'.  In "
+                "cncf.kubernetes provider version 6.0 we will return None when 
namespace is "
+                "not defined in the connection so that it's clear whether user 
intends 'default' or "
+                "whether namespace is unset (which is required in order to 
apply precedence logic in "
+                "KubernetesPodOperator.",

Review Comment:
   i _always_ forget to close parentheses



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