dstandish commented on code in PR #53429:
URL: https://github.com/apache/airflow/pull/53429#discussion_r2223424967


##########
airflow-core/src/airflow/api_fastapi/core_api/routes/ui/dags.py:
##########
@@ -191,3 +195,36 @@ def get_dags(
         total_entries=total_entries,
         dags=list(dag_runs_by_dag_id.values()),
     )
+
+
+@dags_router.get(
+    "/{dag_id}/latest_run",
+    responses=create_openapi_http_exception_doc([status.HTTP_404_NOT_FOUND]),
+    dependencies=[Depends(requires_access_dag(method="GET", 
access_entity=DagAccessEntity.RUN))],
+)
+def get_latest_run_info(dag_id: str, session: SessionDep) -> 
list[DAGRunLightResponse]:
+    """Get latest run."""
+    if dag_id == "~":
+        raise HTTPException(
+            status.HTTP_400_BAD_REQUEST,
+            "`~` was supplied as dag_id, but querying multiple dags is not 
supported.",

Review Comment:
   > Since we already merged get_latest_run that's not relevant but I'm 
concerned for the performance of that public endpoint.
   
   The concern with the public endpoint is valid -- but it's also a different 
issue.
   
   With the private endpoints, there is no backcompat concern.  So it really 
does not cost us anything to simply add an endpoint.  We can remove it or 
change it at any time.  Yes we could alternatively make the public endpoint 
more complex by adding more params and polymorphism to it -- but that does not 
represent a reduction in maintenance burden.  I rather think it's the opposite.



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