BashSensor

使用 BashSensor 来使用任意命令进行感知。该命令成功时应返回 0,否则返回其他值。

airflow/example_dags/example_sensors.py

t3 = BashSensor(task_id="Sensor_succeeds", bash_command="exit 0")

t4 = BashSensor(task_id="Sensor_fails_after_3_seconds", timeout=3, soft_fail=True, bash_command="exit 1")

这条目有帮助吗?