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


##########
airflow-core/src/airflow/api_fastapi/execution_api/routes/dag_runs.py:
##########
@@ -218,3 +219,21 @@ def get_previous_dagrun(
         return None
 
     return DagRun.model_validate(dag_run)
+
+
[email protected](
+    "/{dag_id}/{run_id}/detail",
+    responses={status.HTTP_404_NOT_FOUND: {"description": "DAG Run not 
found"}},

Review Comment:
   ```suggestion
       responses={status.HTTP_404_NOT_FOUND: {"description": "Dag Run not 
found"}},
   ```



##########
task-sdk/tests/task_sdk/execution_time/test_context.py:
##########
@@ -542,8 +544,12 @@ def test_getitem_uri_ref(
     def test_source_task_instance_xcom_pull(self, mock_supervisor_comms, 
accessor):
         events = accessor[Asset("2")]
         assert len(events) == 1
+
+        mock_dag_run = mock.Mock(dag_id="d1", run_id="r1")
+        mock_supervisor_comms.send.side_effect = [mock_dag_run]
         source = events[0].source_task_instance
-        assert source == AssetEventSourceTaskInstance(dag_id="d1", 
task_id="t2", run_id="r1", map_index=-1)
+        assert source == AssetEventSourceTaskInstance(dag_run=mock_dag_run, 
task_id="t2", map_index=-1)
+        
mock_supervisor_comms.send.assert_called_once_with(GetDagRun(dag_id="d1", 
run_id="r1"))

Review Comment:
   ```suggestion
           assert mock_supervisor_comms.calls = [
               call(GetDagRun(dag_id="d1", run_id="r1")),
           ]
   ```
   
   Should we go with what you suggested in the dev list a few months ago?



##########
airflow-core/src/airflow/api_fastapi/execution_api/routes/dag_runs.py:
##########
@@ -142,20 +143,20 @@ def clear_dag_run(
 
 @router.get(
     "/{dag_id}/{run_id}/state",
-    responses={
-        status.HTTP_404_NOT_FOUND: {"description": "DAG not found for the 
given dag_id"},
-    },
+    responses={status.HTTP_404_NOT_FOUND: {"description": "DAG Run not 
found"}},

Review Comment:
   ```suggestion
       responses={status.HTTP_404_NOT_FOUND: {"description": "Dag Run not 
found"}},
   ```



##########
airflow-core/src/airflow/api_fastapi/execution_api/routes/dag_runs.py:
##########
@@ -142,20 +143,20 @@ def clear_dag_run(
 
 @router.get(
     "/{dag_id}/{run_id}/state",
-    responses={
-        status.HTTP_404_NOT_FOUND: {"description": "DAG not found for the 
given dag_id"},
-    },
+    responses={status.HTTP_404_NOT_FOUND: {"description": "DAG Run not 
found"}},
 )
 def get_dagrun_state(
     dag_id: str,
     run_id: str,
     session: SessionDep,
 ) -> DagRunStateResponse:
     """Get a DAG Run State."""
-    dag_run = session.scalar(
-        select(DagRunModel).where(DagRunModel.dag_id == dag_id, 
DagRunModel.run_id == run_id)
+    values = session.scalars(

Review Comment:
   ```suggestion
       dag_run_states = session.scalars(
   ```



##########
airflow-core/src/airflow/api_fastapi/execution_api/routes/dag_runs.py:
##########
@@ -142,20 +143,20 @@ def clear_dag_run(
 
 @router.get(
     "/{dag_id}/{run_id}/state",
-    responses={
-        status.HTTP_404_NOT_FOUND: {"description": "DAG not found for the 
given dag_id"},
-    },
+    responses={status.HTTP_404_NOT_FOUND: {"description": "DAG Run not 
found"}},

Review Comment:
   This is kinda user-facing so I think we should update 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