airflow-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [airflow] BasPH commented on a change in pull request #5990: [AIRFLOW-5390] Remove provide context
Date Tue, 03 Sep 2019 09:42:27 GMT
BasPH commented on a change in pull request #5990: [AIRFLOW-5390] Remove provide context
URL: https://github.com/apache/airflow/pull/5990#discussion_r320181214
 
 

 ##########
 File path: airflow/operators/python_operator.py
 ##########
 @@ -104,10 +97,21 @@ def execute(self, context):
                                  for k, v in airflow_context_vars.items()]))
         os.environ.update(airflow_context_vars)
 
-        if self.provide_context:
-            context.update(self.op_kwargs)
-            context['templates_dict'] = self.templates_dict
+        context.update(self.op_kwargs)
+        context['templates_dict'] = self.templates_dict
+
+        if {parameter for name, parameter
+           in signature(self.python_callable).parameters.items()
+           if str(parameter).startswith("**")}:
 
 Review comment:
   Bit shorter: `{param for param in sig.parameters.values() if str(param).startswith("**")}`
   
   or: `any(str(param).startswith("**") for param in sig.parameters.values())`

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

Mime
View raw message