Skip to content

Instantly share code, notes, and snippets.

@turbaszek
Created November 18, 2020 17:24
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 4 You must be signed in to fork a gist
  • Save turbaszek/38b494126f1b3ab0a2784b3a1c209ab6 to your computer and use it in GitHub Desktop.
Save turbaszek/38b494126f1b3ab0a2784b3a1c209ab6 to your computer and use it in GitHub Desktop.
Sample big dag
import random
from airflow.operators.dummy_operator import DummyOperator
from airflow.models import DAG
from airflow.utils.dates import days_ago
with DAG(
"big_dag",
start_date=days_ago(1),
schedule_interval=None,
) as dag:
start = DummyOperator(task_id="start")
end = DummyOperator(task_id="end")
for i in range(20):
first = DummyOperator(task_id=f"next_{i}")
start >> first
for j in range(random.randint(5, 15)):
next = DummyOperator(task_id=f"next_{i}_{j}")
first >> next
first = next
next >> end
@iamlauriano
Copy link

iamlauriano commented Mar 1, 2021

Wonderful code, I would like to know which program you created this chart.
Thanks @turbaszek
0_LEcmR009iDZdGCGH

@turbaszek
Copy link
Author

@LaurianoElmiroDuarte this is a screen shot from Apache Airflow DAG view

@gualtfor
Copy link

gualtfor commented Jun 6, 2023

thank you for your time and for give me the opportunity to learn

@thatrandomfrenchdude
Copy link

this is awesome, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment