简体   繁体   English

对于 Apache Airflow,子进程无法按预期工作

[英]Subprocess doesn't work as expected with Apache Airflow

I've been testing subprocess for template files in order to understand how this module works and I did many tests calling files from within the same directory as the "main" file and calling files from different directories and it all go well.我一直在测试模板文件的子进程,以了解该模块的工作原理,并且我进行了许多测试,从与“主”文件相同的目录中调用文件并从不同目录调用文件,并且所有 go 都很好。

When trying to integrate this module on a Airflow system, subprocess can never get the file that I am searching for and it doesn't give any errors.当尝试将此模块集成到 Airflow 系统上时,子进程永远无法获取我正在搜索的文件并且它不会给出任何错误。 On this particular situation, I'm trying to call the "test.py" script from the "simple_dag.py" file.在这种特殊情况下,我试图从“simple_dag.py”文件中调用“test.py”脚本。 However, i can't seem to understand why it doesn't execute the method.但是,我似乎无法理解为什么它不执行该方法。

Did you ever had problemas running subprocess within an airflow "environment"?您是否曾经在 airflow “环境”中运行子进程时遇到问题? Do you have any idea how can I fix this problem?你知道我该如何解决这个问题吗? Thank you.谢谢你。

Here is the code of the files:这是文件的代码:

To see the code click here要查看代码,请单击此处

In your pythonOperator try python_callable = _my_name()在你的 pythonOperator 中尝试python_callable = _my_name()

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM