nebius/SWE-rebench-V2-PRs huggingface dataset:
Repository: Quansight/ragna
Pull request #374 (2024-03-20 19:59:24)

updated get_component error message from 404 to 422
Changed a single number

Tengal-Teemo: Sorry @pmeier will fix immediately

Patch:
diff --git a/ragna/deploy/_api/core.py b/ragna/deploy/_api/core.py
index 9c25456..4f42f10 100644
--- a/ragna/deploy/_api/core.py
+++ b/ragna/deploy/_api/core.py
@@ -60,7 +60,7 @@ def app(*, config: Config, ignore_unavailable_components: bool) -> FastAPI:
             raise RagnaException(
                 "Unknown component",
                 display_name=display_name,
-                http_status_code=status.HTTP_404_NOT_FOUND,
+                http_status_code=status.HTTP_422_UNPROCESSABLE_ENTITY,
                 http_detail=RagnaException.MESSAGE,
             )
 


Test patch:
diff --git a/tests/deploy/api/test_components.py b/tests/deploy/api/test_components.py
index 505b0ca..65f0220 100644
--- a/tests/deploy/api/test_components.py
+++ b/tests/deploy/api/test_components.py
@@ -96,7 +96,7 @@ def test_unknown_component(tmp_local_root):
             },
         )
 
-        assert response.status_code == status.HTTP_404_NOT_FOUND
+        assert response.status_code == status.HTTP_422_UNPROCESSABLE_ENTITY
 
         error = response.json()["error"]
         assert "Unknown component" in error["message"]