Skip to content
Merged
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
14 changes: 8 additions & 6 deletions airflow-core/src/airflow/example_dags/example_asset_partition.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,15 +160,17 @@ def check_partition_alignment():

with DAG(
dag_id="ingest_regional_sales",
schedule=CronPartitionTimetable("0 * * * *", timezone="UTC"),
schedule=PartitionAtRuntime(),
tags=["example", "sales", "ingestion"],
):
"""Produce hourly regional sales data with composite partition keys."""
"""Produce regional sales data with composite ``region|timestamp`` partition keys at runtime."""

@task(outlets=[regional_sales])
def ingest_sales():
"""Ingest regional sales data partitioned by region and time."""
pass
def ingest_sales(*, outlet_events=None):
"""Emit one composite ``region|timestamp`` partition per region."""
timestamp = "2026-06-14T03:00:00"
for region in ("us", "eu", "apac"):
outlet_events[regional_sales].add_partitions(f"{region}|{timestamp}")

ingest_sales()

Expand Down Expand Up @@ -205,7 +207,7 @@ def aggregate_sales(dag_run=None):

with DAG(
dag_id="ingest_region_stats",
schedule=None,
schedule=PartitionAtRuntime(),
tags=["example", "player-stats", "regional"],
):
"""
Expand Down
Loading