kaxil commented on a change in pull request #6230: [AIRFLOW-5413] Allow K8S 
worker pod to be configured from JSON/YAML file
URL: https://github.com/apache/airflow/pull/6230#discussion_r365485578
 
 

 ##########
 File path: airflow/kubernetes/pod_generator.py
 ##########
 @@ -470,6 +470,28 @@ def make_unique_pod_id(dag_id):
 
         return safe_pod_id
 
+    @staticmethod
+    def validate_pod_generator_args(given_args):
+        """
+        :param populated_pod_args: The arguments passed to the PodGenerator 
constructor.
+        :type populated_pod_args: dict
+        :return: None
+
+        Validate that if `pod` or `pod_template_file` are set that the user is 
not attempting
+        to configure the pod with the other arguments.
+        """
+        pod_args = 
list(inspect.signature(PodGenerator.__init__).parameters.items())[1:]
+
+        def predicate(k, v):
+            return (v.default is None or v.default is v.empty) and k != 'pod' 
and k != 'pod_template_file'
 
 Review comment:
   Can we add docstring to this function

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to