pierrejeambrun commented on code in PR #43506:
URL: https://github.com/apache/airflow/pull/43506#discussion_r1842191722


##########
airflow/api_fastapi/core_api/routes/public/dag_run.py:
##########
@@ -147,3 +156,70 @@ def patch_dag_run(
     dag_run = session.get(DagRun, dag_run.id)
 
     return DAGRunResponse.model_validate(dag_run, from_attributes=True)
+
+
+@dag_run_router.get("/", responses=create_openapi_http_exception_doc([401]))
+async def get_dag_runs(
+    dag_id: str,
+    limit: QueryLimit,
+    offset: QueryOffset,
+    logical_date: Annotated[
+        RangeFilter, Depends(datetime_range_filter_factory("logical_date", 
DagRun, "execution_date"))
+    ],
+    start_date_range: Annotated[RangeFilter, 
Depends(datetime_range_filter_factory("start_date", DagRun))],
+    end_date_range: Annotated[RangeFilter, 
Depends(datetime_range_filter_factory("end_date", DagRun))],
+    update_at_range: Annotated[RangeFilter, 
Depends(datetime_range_filter_factory("updated_at", DagRun))],
+    state: QueryDagRunStateFilter,
+    order_by: Annotated[
+        SortParam,
+        Depends(
+            SortParam(
+                [
+                    "id",
+                    "state",
+                    "dag_id",
+                    "execution_date",
+                    "dag_run_id",
+                    "start_date",
+                    "end_date",
+                    "updated_at",
+                    "external_trigger",
+                    "conf",
+                ],
+                DagRun,
+            ).dynamic_depends(default="id")
+        ),
+    ],
+    session: Annotated[Session, Depends(get_session)],
+    # fields: list[str] | None = Query(None),

Review Comment:
   For now you can just skip `fields`. Because it's an issue to implement and 
dynamically change the returned type. (sub fields etc...), which isn't great 
for the client.
   
   This is mentioned here 
https://github.com/apache/airflow/issues/43378#issue-2613951437, as one of the 
breaking change.
   
   We can either fix that later before 3.0 release, or accept that breaking 
change. In the mean time I would suggest to just remove it and don't bother 
with it.



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