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


##########
airflow-core/src/airflow/api_fastapi/core_api/routes/public/task_instances.py:
##########
@@ -484,11 +484,16 @@ def get_task_instances(
         
select(TI).join(TI.dag_run).outerjoin(TI.dag_version).options(*eager_load_TI_and_TIH_for_validation())
     )
     if dag_run_id != "~":
-        dag_run = session.scalar(select(DagRun).filter_by(run_id=dag_run_id))
+        if dag_id == "~":
+            raise HTTPException(
+                status.HTTP_400_BAD_REQUEST,
+                "dag_id is required when dag_run_id is specified",
+            )
+        dag_run = session.scalar(select(DagRun).where(DagRun.dag_id == dag_id, 
DagRun.run_id == dag_run_id))

Review Comment:
   Can you add `status.HTTP_400_BAD_REQUEST,` to the 
`create_openapi_http_exception_doc`, this is necessary for the documentation to 
be up to date. 
   
   (And regenerate the specs, this is done in the pre-commit hooks 



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