小编Sas*_*ora的帖子

强制气流以退出代码 1 终止

我在 Airflow 中运行的一些任务偶尔会因为各种原因而失败。有些是我抓到的,有些是新的,也不例外。我想获得退出代码 1 以便收到此类故障的通知。

下面是一个我没有排除的错误示例,有没有办法让 ValueError 产生退出代码 1?

[2019-06-13 12:56:13,630] {bash_operator.py:127} INFO - ValueError: year 43631 is out of range
[2019-06-13 12:56:13,870] {bash_operator.py:127} INFO - 2019-06-13 12:56:13,869 - ODL - INFO - Closing db connection
[2019-06-13 12:56:13,870] {bash_operator.py:127} INFO - 2019-06-13 12:56:13,870 - ODL - INFO - End
[2019-06-13 12:56:13,990] {bash_operator.py:131} INFO - Command exited with return code 0
[2019-06-13 12:56:17,556] {logging_mixin.py:95} INFO - [2019-06-13 12:56:17,555] {jobs.py:2562} INFO - Task exited with return code 0
Run Code Online (Sandbox Code Playgroud)

我还有其他一些代码,其中 try 块使用sys.exit(1) …

python directed-acyclic-graphs airflow

5
推荐指数
1
解决办法
2492
查看次数

标签 统计

airflow ×1

directed-acyclic-graphs ×1

python ×1