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")