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 2020/02/28 11:11:41 UTC

[GitHub] [airflow] nuclearpinguin commented on a change in pull request #7576: [AIRFLOW-6933] Pass in env vars for all operators

nuclearpinguin commented on a change in pull request #7576: [AIRFLOW-6933] Pass in env vars for all operators
URL: https://github.com/apache/airflow/pull/7576#discussion_r385638634
 
 

 ##########
 File path: airflow/models/taskinstance.py
 ##########
 @@ -915,6 +916,12 @@ def signal_handler(signum, frame):
                 start_time = time.time()
 
                 self.render_templates(context=context)
+                # Export context to make it available for operators to use.
+                airflow_context_vars = context_to_airflow_vars(context, in_env_var_format=True)
+                self.log.info("Exporting the following env vars:\n%s",
+                              '\n'.join(["{}={}".format(k, v)
 
 Review comment:
   ```suggestion
                   vars = [list(i) for i in airflov_context_vars.itmes()] 
                   self.log.info("Exporting the following env vars:\n" + "%s=%s\n" * len(vars), *sum(vars, []))
   ```
   What do you think? In this way we will fix one pylint error (not caught yet because this file is still in todo) :)

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