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 36dd823770b Fix backward compatibility for DagRunInfo partition fields 
(#68342)
36dd823770b is described below

commit 36dd823770b8578b044f68786626e3b25972eb8f
Author: Bramhanand Lingala <[email protected]>
AuthorDate: Fri Jun 12 14:52:18 2026 +0530

    Fix backward compatibility for DagRunInfo partition fields (#68342)
    
    Co-authored-by: AKHIL <[email protected]>
    Co-authored-by: Wei Lee <[email protected]>
---
 airflow-core/src/airflow/timetables/base.py              |  4 ++--
 .../tests/unit/timetables/test_trigger_timetable.py      | 16 ++++++++++++++++
 2 files changed, 18 insertions(+), 2 deletions(-)

diff --git a/airflow-core/src/airflow/timetables/base.py 
b/airflow-core/src/airflow/timetables/base.py
index b1ade1e888e..f53f6010f98 100644
--- a/airflow-core/src/airflow/timetables/base.py
+++ b/airflow-core/src/airflow/timetables/base.py
@@ -143,8 +143,8 @@ class DagRunInfo(NamedTuple):
     data_interval: DataInterval | None
     """The data interval this DagRun to operate over."""
 
-    partition_date: DateTime | None
-    partition_key: str | None
+    partition_date: DateTime | None = None
+    partition_key: str | None = None
 
     @classmethod
     def exact(cls, at: DateTime) -> DagRunInfo:
diff --git a/airflow-core/tests/unit/timetables/test_trigger_timetable.py 
b/airflow-core/tests/unit/timetables/test_trigger_timetable.py
index 114080685ca..ca6ada9dfb2 100644
--- a/airflow-core/tests/unit/timetables/test_trigger_timetable.py
+++ b/airflow-core/tests/unit/timetables/test_trigger_timetable.py
@@ -834,3 +834,19 @@ def test_generate_run_id_without_partition_key() -> None:
         data_interval=None,
     )
     assert run_id.startswith("manual__2025-06-07T08:09:00+00:00__")
+
+
+def test_dagruninfo_backward_compatibility() -> None:
+    start = pendulum.datetime(2025, 1, 1, tz="UTC")
+    end = pendulum.datetime(2025, 1, 2, tz="UTC")
+
+    info = DagRunInfo(
+        run_after=end,
+        data_interval=DataInterval(
+            start=start,
+            end=end,
+        ),
+    )
+
+    assert info.partition_date is None
+    assert info.partition_key is None

Reply via email to