kaxil commented on code in PR #43243:
URL: https://github.com/apache/airflow/pull/43243#discussion_r1818240587


##########
tests/api_connexion/endpoints/test_task_instance_endpoint.py:
##########
@@ -1983,15 +1983,15 @@ def test_should_call_mocked_api(self, 
mock_set_task_instance_state, session):
         self.create_task_instances(session)
 
         NEW_STATE = "failed"
-        mock_set_task_instance_state.return_value = session.get(
-            TaskInstance,
-            {
-                "task_id": "print_the_context",
-                "dag_id": "example_python_operator",
-                "run_id": "TEST_DAG_RUN_ID",
-                "map_index": -1,
-            },
-        )
+        mock_set_task_instance_state.return_value = session.scalars(
+            select(TaskInstance).where(
+                TaskInstance.dag_id == "example_python_operator",
+                TaskInstance.task_id == "print_the_context",
+                TaskInstance.run_id == "TEST_DAG_RUN_ID",
+                TaskInstance.map_index == -1,
+            )
+        ).one_or_none()
+

Review Comment:
   The reason for this and other changes in this file is explained in [**Issues 
identified Point 
(2)**](https://github.com/apache/airflow/pull/43243#issuecomment-2439774584)
   



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