From the tutorial, this is normal:
t2 = BashOperator( task_id='sleep', bash_command='sleep 5', retries=3, dag=dag)
But you pass a multiline command
create_command = """ ./scripts/create_file.sh """
should be
create_command = "./scripts/create_file.sh "
In addition, you must also make sure that you are in the correct directory to avoid cryptic errors. Do this, for example, like this:
create_command = "./scripts/create_file.sh" if os.path.exists(create_command): t1 = BashOperator( task_id= 'create_file', bash_command=create_command, dag=dag ) else: raise Exception("Cannot locate {}".format(create_command))
source share