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..ca6ada9dfb251 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