From 04a11628682118ed537bb1496eba08f01b8ce070 Mon Sep 17 00:00:00 2001 From: AKHIL Date: Wed, 10 Jun 2026 18:42:33 +0530 Subject: [PATCH 1/5] Fix backward compatibility for DagRunInfo partition fields --- airflow-core/src/airflow/timetables/base.py | 4 ++-- .../unit/timetables/test_trigger_timetable.py | 15 +++++++++++++++ 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/airflow-core/src/airflow/timetables/base.py b/airflow-core/src/airflow/timetables/base.py index b1ade1e888ea2..f53f6010f980f 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 114080685ca5a..088085d60e9e6 100644 --- a/airflow-core/tests/unit/timetables/test_trigger_timetable.py +++ b/airflow-core/tests/unit/timetables/test_trigger_timetable.py @@ -834,3 +834,18 @@ 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(): + 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 + \ No newline at end of file From c516343ede1c8905f613a714b4575f02a0f6041e Mon Sep 17 00:00:00 2001 From: bramhanandlingala Date: Thu, 11 Jun 2026 11:32:46 +0530 Subject: [PATCH 2/5] Fix lint issues in timetable compatibility test --- airflow-core/tests/unit/timetables/test_trigger_timetable.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/airflow-core/tests/unit/timetables/test_trigger_timetable.py b/airflow-core/tests/unit/timetables/test_trigger_timetable.py index 088085d60e9e6..eeaa340ba76ea 100644 --- a/airflow-core/tests/unit/timetables/test_trigger_timetable.py +++ b/airflow-core/tests/unit/timetables/test_trigger_timetable.py @@ -834,7 +834,7 @@ 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(): +def test_dagruninfo_backward_compatibility() -> None: start = pendulum.datetime(2025, 1, 1, tz="UTC") end = pendulum.datetime(2025, 1, 2, tz="UTC") @@ -847,5 +847,4 @@ def test_dagruninfo_backward_compatibility(): ) assert info.partition_date is None - assert info.partition_key is None - \ No newline at end of file + assert info.partition_key is None \ No newline at end of file From 228e1c17178032210e4b78deadbf5644b6e7100f Mon Sep 17 00:00:00 2001 From: bramhanandlingala Date: Fri, 12 Jun 2026 11:34:46 +0530 Subject: [PATCH 3/5] Fix formatting issues --- airflow-core/tests/unit/timetables/test_trigger_timetable.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/airflow-core/tests/unit/timetables/test_trigger_timetable.py b/airflow-core/tests/unit/timetables/test_trigger_timetable.py index eeaa340ba76ea..1da7bdf7224b4 100644 --- a/airflow-core/tests/unit/timetables/test_trigger_timetable.py +++ b/airflow-core/tests/unit/timetables/test_trigger_timetable.py @@ -834,6 +834,8 @@ 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") @@ -847,4 +849,5 @@ def test_dagruninfo_backward_compatibility() -> None: ) assert info.partition_date is None - assert info.partition_key is None \ No newline at end of file + assert info.partition_key is None + \ No newline at end of file From d647de80f25a3c5805510f462df0e63a098a1fd2 Mon Sep 17 00:00:00 2001 From: bramhanandlingala Date: Fri, 12 Jun 2026 12:10:49 +0530 Subject: [PATCH 4/5] Fix formatting issues --- airflow-core/tests/unit/timetables/test_trigger_timetable.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/airflow-core/tests/unit/timetables/test_trigger_timetable.py b/airflow-core/tests/unit/timetables/test_trigger_timetable.py index 1da7bdf7224b4..0bcefd1f4732b 100644 --- a/airflow-core/tests/unit/timetables/test_trigger_timetable.py +++ b/airflow-core/tests/unit/timetables/test_trigger_timetable.py @@ -850,4 +850,4 @@ def test_dagruninfo_backward_compatibility() -> None: assert info.partition_date is None assert info.partition_key is None - \ No newline at end of file + \ No newline at end of file From 60a12c9de1af47c96507313b5364f60276e9aa3d Mon Sep 17 00:00:00 2001 From: Wei Lee Date: Fri, 12 Jun 2026 15:26:51 +0800 Subject: [PATCH 5/5] fixup! Merge branch 'main' into fix-68315 --- airflow-core/tests/unit/timetables/test_trigger_timetable.py | 1 - 1 file changed, 1 deletion(-) diff --git a/airflow-core/tests/unit/timetables/test_trigger_timetable.py b/airflow-core/tests/unit/timetables/test_trigger_timetable.py index 0bcefd1f4732b..ca6ada9dfb251 100644 --- a/airflow-core/tests/unit/timetables/test_trigger_timetable.py +++ b/airflow-core/tests/unit/timetables/test_trigger_timetable.py @@ -850,4 +850,3 @@ def test_dagruninfo_backward_compatibility() -> None: assert info.partition_date is None assert info.partition_key is None - \ No newline at end of file