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 2021/03/05 23:21:11 UTC

[GitHub] [airflow] mik-laj commented on issue #14620: Using env in BashOperator results in invalid SyntaxError

mik-laj commented on issue #14620:
URL: https://github.com/apache/airflow/issues/14620#issuecomment-791784644


   This doesn't look like a problem with Aiirflow, but your script is not compatible with Python 2 and the default system interpreter is Python 2 on your system. You probably use virtual environments and you didn't pass the information on to the subprocess.
   
   Can you try the code below?
   ````
       my_task = BashOperator(
           task_id='my-task',
           bash_command=f"python /Users/bilbo/hello.py",
           env={**os.environ, 'name': 'AirFlow'}
       )
   
   ````


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