定时调度是通过DAG的schedule_interval参数定义,传参可以是datetime.timedelta对象、cron表达式(Unix格式)或者@daily、@monthly等预设cron表达式。对于任务调度时间的定义,Airflow采用了目前我所接触到的任务调度系统中不同的视角,用数据时间(Airflow称它为logical date,有的系统称它为etl_date)来定义任务调度时间。举个例...
手动触发时,有一个选项 trigger DAG with config,点击进去可以选择logical date,例如前天或者大前天的任务;但是如果选择明天的时间,会发现这个任务会处于排队queue的状态。 注意,虽然在DAG中设置了时区,但是在传递给task函数的模板变量,例如execution_date、ts等,还是维持为UTC时间。因为本质上,airflow内部还是统一使用U...
针对2),在DAG的配置函数中有一个参数schedule_interval,约定被调度的频次,是按照每天、每周或者固定的时间来执行。这个参数,跟start_date开始时间和end_date结束时间(需要某个时间段后不需要执行该任务)配合着用,来约定什么时候跑这个DAG。logical date指的是这个DAG后续预计执行发生的时间。 下图是参数设置为@daily的...
"external_trigger":true, "last_scheduling_decision":null, "logical_date":"2024-05-06T07:00:53.063345+00:00", "note":null, "run_type":"manual", "start_date":null, "state":"queued" }
针对2),在DAG的配置函数中有一个参数schedule_interval,约定被调度的频次,是按照每天、每周或者固定的时间来执行。这个参数,跟start_date开始时间和end_date结束时间(需要某个时间段后不需要执行该任务)配合着用,来约定什么时候跑这个DAG。logical date指的是这个DAG后续预计执行发生的时间。
execution_date是logical datetime,是DAG指定运行的时间,它可以是过去或将来的某个时间尽管DAG实际上是正在运行的。 Task Task是DAG中定义工作的基本单位,它的地位等同于工作流中的一个节点。Task和Operator是一枚硬币的正反两面,Task代表工作的抽象概念,Operator定义了对应Task要做的具体任务。 同一个DAG中的Task之间一...
triggered_date == execution_date. if dag_run.external_trigger: return logical_date if dag is None: return None next_info = dag.next_dagrun_info(data_interval, restricted=False) if next_info is None: return None return timezone.coerce_datetime(next_info.logical_date)...
"logical_date": "2023-08-14T03:59:02+00:00", "note": null, "run_type": "manual", "start_date": null, "state": "queued" } [root@airflow script]# trigger_target -d test-skip -p $i -o param -m test-skip true {
# This should not throw an error as logical_date is part of airflow context. logical_date = context["logical_date"] Contributor Lee-W Dec 26, 2024 @sunank200 and I discussed this earlier. What we're trying to check is whether there's a variable named as context in a function (mo...
'logical_date', 'next_execution_date', 'prev_data_interval_end_success', 'prev_data_interval_start_success', 'prev_execution_date', 'prev_execution_date_success', 'prev_start_date_success', } AIRFLOW_SERIALIZABLE_CONTEXT_KEYS = {