Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use schedule param rather than timetable in Timetables docs #29255

Merged
merged 1 commit into from
Jan 31, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions docs/apache-airflow/authoring-and-scheduling/timetable.rst
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,7 @@ A timetable that accepts a cron expression, and triggers DAG runs according to i
from airflow.timetables.trigger import CronTriggerTimetable


@dag(
timetable=CronTriggerTimetable("0 1 * * 3", timezone="UTC"), # At 01:00 on Wednesday
)
@dag(schedule=CronTriggerTimetable("0 1 * * 3", timezone="UTC"), ...) # At 01:00 on Wednesday
def example_dag():
pass

Expand All @@ -97,11 +95,12 @@ run's data interval would span the specified duration, and *ends* with the trigg

@dag(
# Runs every Friday at 18:00 to cover the work week (9:00 Monday to 18:00 Friday).
timetable=CronTriggerTimetable(
schedule=CronTriggerTimetable(
"0 18 * * 5",
timezone="UTC",
interval=timedelta(days=4, hours=9),
),
...,
)
def example_dag():
pass
Expand Down Expand Up @@ -158,7 +157,7 @@ first) event for the data interval, otherwise manual runs will run with a ``data


@dag(
timetable=EventsTimetable(
schedule=EventsTimetable(
event_dates=[
pendulum.datetime(2022, 4, 5, 8, 27, tz="America/Chicago"),
pendulum.datetime(2022, 4, 17, 8, 27, tz="America/Chicago"),
Expand All @@ -167,6 +166,7 @@ first) event for the data interval, otherwise manual runs will run with a ``data
description="My Team's Baseball Games",
restrict_to_events=False,
),
...,
)
def example_dag():
pass
Expand Down
16 changes: 8 additions & 8 deletions docs/apache-airflow/howto/timetable.rst
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,9 @@ file:
with DAG(
dag_id="example_after_workday_timetable_dag",
start_date=pendulum.datetime(2021, 3, 10, tz="UTC"),
timetable=AfterWorkdayTimetable(),
schedule=AfterWorkdayTimetable(),
tags=["example", "timetable"],
) as dag:
):
...


Expand Down Expand Up @@ -200,9 +200,9 @@ For reference, here's our plugin and DAG files in their entirety:
with DAG(
dag_id="example_workday_timetable",
start_date=pendulum.datetime(2021, 1, 1, tz="UTC"),
timetable=AfterWorkdayTimetable(),
schedule=AfterWorkdayTimetable(),
tags=["example", "timetable"],
) as dag:
):
EmptyOperator(task_id="run_this")


Expand Down Expand Up @@ -270,9 +270,9 @@ So for a DAG declared like this:
.. code-block:: python

with DAG(
timetable=SometimeAfterWorkdayTimetable(Time(8)), # 8am.
schedule=SometimeAfterWorkdayTimetable(Time(8)), # 8am.
...,
) as dag:
):
...

The *Schedule* column would say ``after each workday, at 08:00:00``.
Expand Down Expand Up @@ -312,9 +312,9 @@ So for a DAG declared like this:
.. code-block:: python

with DAG(
timetable=SometimeAfterWorkdayTimetable(Time(8)), # 8am.
schedule=SometimeAfterWorkdayTimetable(Time(8)), # 8am.
...,
) as dag:
):
...

The *i* icon would show, ``Schedule: after each workday, at 08:00:00``.
Expand Down