← mined_oracle

fastapi_9929

failed WRONG_FIX UNSUBMITTED wrong_fix_unsubmitted(None) · None tool calls · 0 s · fastapi/fastapi

Task input

(not found in data/tasks.jsonl)

Tool calls (0)

#ToolArgumentsResult
No trace captured.

Patch

--- a/fastapi/encoders.py
+++ b/fastapi/encoders.py
@@ -24,7 +24,7 @@ from pydantic.networks import AnyUrl, NameEmail
 from pydantic.types import SecretBytes, SecretStr
 from typing_extensions import Annotated, Doc
 
-from ._compat import PYDANTIC_V2, Url, _model_dump
+from ._compat import PYDANTIC_V2, UndefinedType, Url, _model_dump
 
 
 # Taken from Pydantic v1 as is
@@ -259,6 +259,8 @@ def jsonable_encoder(
         return str(obj)
     if isinstance(obj, (str, int, float, type(None))):
         return obj
+    if isinstance(obj, UndefinedType):
+        return None
     if isinstance(obj, dict):
         encoded_dict = {}
         allowed_keys = set(obj.keys())

Test output

show
==================================== ERRORS ====================================
________________________ ERROR collecting tests/main.py ________________________
tests/main.py:6: in <module>
    app = FastAPI()
          ^^^^^^^^^
fastapi/applications.py:896: in __init__
    ] = webhooks or routing.APIRouter()
                    ^^^^^^^^^^^^^^^^^^^
fastapi/routing.py:787: in __init__
    super().__init__(
E   TypeError: Router.__init__() got an unexpected keyword argument 'on_startup'
=============================== warnings summary ===============================
fastapi/applications.py:18
  /private/tmp/swe_work/mined_oracle/fastapi_9929/b/workspace/fastapi/applications.py:18: StarletteDeprecationWarning: 'HTTP_422_UNPROCESSABLE_ENTITY' is deprecated. Use 'HTTP_422_UNPROCESSABLE_CONTENT' instead.
    from fastapi.exception_handlers import (

fastapi/applications.py:30
  /private/tmp/swe_work/mined_oracle/fastapi_9929/b/workspace/fastapi/applications.py:30: StarletteDeprecationWarning: 'HTTP_422_UNPROCESSABLE_ENTITY' is deprecated. Use 'HTTP_422_UNPROCESSABLE_CONTENT' instead.
    from fastapi.openapi.utils import get_openapi

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
!!!!!!!!!!!!!!!!!!!!!!!!!! stopping after 1 failures !!!!!!!!!!!!!!!!!!!!!!!!!!!
2 warnings, 1 error in 0.39s