Lee-W commented on code in PR #63631:
URL: https://github.com/apache/airflow/pull/63631#discussion_r2945390413


##########
airflow-core/tests/unit/api_fastapi/core_api/routes/ui/test_calendar.py:
##########
@@ -181,3 +183,120 @@ def test_hourly_calendar(self, setup_dag_runs, 
test_client, query_params, result
         body = response.json()
 
         assert body == result
+
+
+class TestPartitionedCalendar:
+    """Calendar tests for partitioned Dags (AIP-76) which use partition_date 
instead of logical_date."""
+
+    DAG_NAME = "test_partitioned_dag"
+
+    @pytest.fixture(autouse=True)
+    @provide_session
+    def setup_dag_runs(self, dag_maker, session=None) -> None:
+        clear_db_runs()
+        clear_db_dags()
+        with dag_maker(
+            self.DAG_NAME,
+            schedule=CronPartitionTimetable("0 0 * * *", 
timezone=pendulum.UTC),
+            start_date=datetime(2025, 1, 1),
+            catchup=True,
+            serialized=True,
+            session=session,
+        ):
+            EmptyOperator(task_id="test_task1")
+        dag_maker.create_dagrun(
+            run_id="part_run_1",
+            state=DagRunState.SUCCESS,
+            logical_date=None,
+            partition_date=datetime(2025, 1, 1, tzinfo=pendulum.UTC),
+            partition_key="2025-01-01T00:00:00",
+        )
+        dag_maker.create_dagrun(
+            run_id="part_run_2",
+            state=DagRunState.FAILED,
+            logical_date=None,
+            partition_date=datetime(2025, 1, 2, tzinfo=pendulum.UTC),
+            partition_key="2025-01-02T00:00:00",
+        )
+        dag_maker.create_dagrun(

Review Comment:
   We could add a few test cases that include DagRun without `partition_date` 
and see how it works.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to