Skip to content

Commit

Permalink
Fix imports in example DAG
Browse files Browse the repository at this point in the history
  • Loading branch information
uranusjr committed Sep 13, 2021
1 parent 02be21a commit 8897d1a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
5 changes: 1 addition & 4 deletions airflow/example_dags/example_workday_timetable.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,13 @@

"""Example DAG demostrating how to implement a custom timetable for a DAG."""

from plugins.workday import AfterWorkdayTimetable

# [START howto_timetable]
from airflow import DAG
from airflow.example_dags.plugins.workday import AfterWorkdayTimetable
from airflow.operators.dummy import DummyOperator

# [START howto_timetable_example_dag]
with DAG(timetable=AfterWorkdayTimetable(), tags=["example", "timetable"]) as dag:
DummyOperator(task_id="run_this")
# [END howto_timetable_example_dag]

if __name__ == "__main__":
dag.cli()
Expand Down
12 changes: 7 additions & 5 deletions docs/apache-airflow/howto/timetable.rst
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,13 @@ Next, we'll start putting code into ``AfterWorkdayTimetable``. After the
implementation is finished, we should be able to use the timetable in our DAG
file:

.. exampleinclude:: /../../airflow/example_dags/example_workday_timetable.py
:language: python
:dedent: 4
:start-after: [START howto_timetable_example_dag]
:end-before: [END howto_timetable_example_dag]
.. code-block:: python
from airflow import DAG
with DAG(timetable=AfterWorkdayTimetable(), tags=["example", "timetable"]) as dag:
...
Define Scheduling Logic
Expand Down

0 comments on commit 8897d1a

Please sign in to comment.