This is an automated email from the ASF dual-hosted git repository.

Lee-W pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git


The following commit(s) were added to refs/heads/main by this push:
     new 75f7fcd2e04 Fix runtime-partition example Dags using unreachable 
schedules (#68719)
75f7fcd2e04 is described below

commit 75f7fcd2e04f3d4dedf441ae1fa7f15123859262
Author: Wei Lee <[email protected]>
AuthorDate: Mon Jun 22 11:51:13 2026 +0800

    Fix runtime-partition example Dags using unreachable schedules (#68719)
---
 .../src/airflow/example_dags/example_asset_partition.py    | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/airflow-core/src/airflow/example_dags/example_asset_partition.py 
b/airflow-core/src/airflow/example_dags/example_asset_partition.py
index baba6ced1fc..549db8cef96 100644
--- a/airflow-core/src/airflow/example_dags/example_asset_partition.py
+++ b/airflow-core/src/airflow/example_dags/example_asset_partition.py
@@ -160,15 +160,17 @@ regional_sales = 
Asset(uri="file://incoming/sales/regional.csv", name="regional_
 
 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()
 
@@ -205,7 +207,7 @@ region_raw_stats = 
Asset(uri="file://incoming/player-stats/by-region.csv", name=
 
 with DAG(
     dag_id="ingest_region_stats",
-    schedule=None,
+    schedule=PartitionAtRuntime(),
     tags=["example", "player-stats", "regional"],
 ):
     """

Reply via email to