- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
我想在 DAG A 和 DAG B 上创建 dag 依赖项。DAG A 有两个任务:TASK1 和 TASK2。 DAG B 有 3 个任务:TASK1、TASK2 和 TASK3。
我的要求是 DAG B 在 DAG A TASK1 之后开始。
两个 DAGS 都每小时运行一次,DAG A 运行@every hours EX: 10.00 and DAG B runs @every hour ex:10.30.
我正在使用 Airflow 和运算符 EXternalTaskSensors,但它不工作。
external_dag_id='DAG A',
external_task_id='TASK1',
allowed_states=None,
execution_delta=None,
execution_date_fn=None,
最佳答案
如果你在那里检查 execution_delta
,你没有,文档[ https://github.com/apache/incubator-airflow/blob/master/airflow/operators/sensors.py#L194]说:
:param execution_delta:time difference with the previous execution to look at, the default is the same execution_date as the current task. For yesterday, use [positive!] datetime.timedelta(days=1). Either execution_delta or execution_date_fn can be passed to ExternalTaskSensor, but not both.
简短的回答是,因为你在不同的时间运行 DAG A 和 DAG B,你需要放置 execution_delta,否则,它假设你的其他 DAG 同时运行,在这种情况下,没有找到 DAG 运行并且你可能会得到意想不到的东西。所以尝试像 datetime.timedelta(minutes=30)
关于python - Airflow ExternalTaskSensors - 创建 dags 依赖,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46279361/
我是一名优秀的程序员,十分优秀!