You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2019/09/03 09:41:54 UTC

[GitHub] [airflow] BasPH commented on a change in pull request #5990: [AIRFLOW-5390] Remove provide context

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(params).startswith("**") for params 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