airflow任务运行抛出jinja2.exceptions.TemplateNotFound

匿名 (未验证) 提交于 2019-12-03 00:36:02

这是由于airflow使用了jinja2作为模板引擎导致的一个陷阱,当使用bash命令的时候,尾部必须加一个空格:

  • herebash_commandBashOperator
t2 = BashOperator( task_id=‘sleep‘, bash_command="/home/batcher/test.sh", // This fails with `Jinja template not found` error #bash_command="/home/batcher/test.sh ", // This works (has a space after) dag=dag)

参考链接:

https://stackoverflow.com/questions/42147514/templatenotfound-error-when-running-simple-airflow-bashoperator

https://cwiki.apache.org/confluence/display/AIRFLOW/Common+Pitfalls

原文:https://www.cnblogs.com/cord/p/9226628.html

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!