failed NO_PATCH NO_PATCH UNSUBMITTED empty_patch(budget) ยท 4 tool calls ยท 308 s ยท fastapi/fastapi
๐ Add a custom `FastAPIDeprecationWarning` ๐ Add a custom `FastAPIDeprecationWarning` and use it for deprecated logic, like Pydantic v1 models. Motivated by: https://sethmlarson.dev/deprecations-via-warnings-dont-work-for-python-libraries
| # | Tool | Arguments | Result |
|---|---|---|---|
| 1 | run_command | {
"command": "grep -rn \"DeprecationWarning\" fastapi | head -20"
} | {"status": "ok", "stdout": "fastapi/dependencies/utils.py:330: category=DeprecationWarning,\nfastapi/temp_pydantic_v1_params.py:66: category=DeprecationWarning,full{"status": "ok", "stdout": "fastapi/dependencies/utils.py:330: category=DeprecationWarning,\nfastapi/temp_pydantic_v1_params.py:66: category=DeprecationWarning,\nfastapi/temp_pydantic_v1_params.py:96: category=DeprecationWarning,\nfastapi/temp_pydantic_v1_params.py:506: category=DeprecationWarning,\nfastapi/temp_pydantic_v1_params.py:536: category=DeprecationWarning,\nfastapi/routing.py:643: category=DeprecationWarning,\nfastapi/routing.py:683: category=DeprecationWarning,\nfastapi/utils.py:200: DeprecationWarning,\nfastapi/params.py:78: category=DeprecationWarning,\nfastapi/params.py:108: category=DeprecationWarning,\nfastapi/params.py:533: category=DeprecationWarning,\nfastapi/params.py:563: category=DeprecationWarning,\nfastapi/openapi/utils.py:220: DeprecationWarning,\n", "exit_code": 0} |
| 2 | run_command | {
"command": "grep -rn \"pydantic.v1\" fastapi | head -20"
} | {"status": "ok", "stdout": "fastapi/dependencies/utils.py:47:from fastapi._compat.shared import annotation_is_pydantic_v1\nfastapi/dependencies/utils.py:75:fromfull{"status": "ok", "stdout": "fastapi/dependencies/utils.py:47:from fastapi._compat.shared import annotation_is_pydantic_v1\nfastapi/dependencies/utils.py:75:from .. import temp_pydantic_v1_params\nfastapi/dependencies/utils.py:328: \"pydantic.v1 is deprecated and will soon stop being supported by FastAPI.\"\nfastapi/dependencies/utils.py:334: param_details.field.field_info, (params.Body, temp_pydantic_v1_params.Body)\nfastapi/dependencies/utils.py:403: temp_pydantic_v1_params.Param,\nfastapi/dependencies/utils.py:405: temp_pydantic_v1_params.Body,\nfastapi/dependencies/utils.py:494: if annotation_is_pydantic_v1(use_annotation):\nfastapi/dependencies/utils.py:495: field_info = temp_pydantic_v1_params.Body( # type: ignore[assignment]\nfastapi/dependencies/utils.py:511: field_info, (params.Path, temp_pydantic_v1_params.Path)\nfastapi/dependencies/utils.py:517: isinstance(field_info, (params.Param, temp_pydantic_v1_params.Param))\nfastapi/dependencies/utils.py:526: if isinstance(field_info, (params.Form, temp_pydantic_v1_params.Form)):\nfastapi/dependencies/utils.py:546: elif isinstance(field_info, (params.Query, temp_pydantic_v1_params.Query)):\nfastapi/dependencies/utils.py:765: isinstance(field.field_info, (params.Form, temp_pydantic_v1_params.Form))\nfastapi/dependencies/utils.py:835: assert isinstance(field_info, (params.Param, temp_pydantic_v1_params.Param)), (\nfastapi/dependencies/utils.py:847: assert isinstance(field_info, (params.Param, temp_pydantic_v1_params.Param)), (\nfastapi/dependencies/utils.py:896: isinstance(first_field.field_info, (params.Form, temp_pydantic_v1_params.Form))\nfastapi/dependencies/utils.py:914: isinstance(field_info, (params.File, temp_pydantic_v1_params.File))\nfastapi/dependencies/utils.py:921: and isinstance(field_info, (params.File, temp_pydantic_v1_ |
| 3 | run_command | {
"command": "grep -rn \"pydantic v1\" fastapi | head -20"
} | {"status": "ok", "stdout": "fastapi/routing.py:255: # pydantic v1\n", "exit_code": 0}full{"status": "ok", "stdout": "fastapi/routing.py:255: # pydantic v1\n", "exit_code": 0} |
| 4 | read_file | {
"filepath": "fastapi/exceptions.py"
} | {"status": "ok", "filepath": "fastapi/exceptions.py", "content": "from collections.abc import Sequence\nfrom typing import Annotated, Any, Optional, TypedDict, full{"status": "ok", "filepath": "fastapi/exceptions.py", "content": "from collections.abc import Sequence\nfrom typing import Annotated, Any, Optional, TypedDict, Union\n\nfrom annotated_doc import Doc\nfrom pydantic import BaseModel, create_model\nfrom starlette.exceptions import HTTPException as StarletteHTTPException\nfrom starlette.exceptions import WebSocketException as StarletteWebSocketException\n\n\nclass EndpointContext(TypedDict, total=False):\n function: str\n path: str\n file: str\n line: int\n\n\nclass HTTPException(StarletteHTTPException):\n \"\"\"\n An HTTP exception you can raise in your own code to show errors to the client.\n\n This is for client errors, invalid authentication, invalid data, etc. Not for server\n errors in your code.\n\n Read more about it in the\n [FastAPI docs for Handling Errors](https://fastapi.tiangolo.com/tutorial/handling-errors/).\n\n ## Example\n\n ```python\n from fastapi import FastAPI, HTTPException\n\n app = FastAPI()\n\n items = {\"foo\": \"The Foo Wrestlers\"}\n\n\n @app.get(\"/items/{item_id}\")\n async def read_item(item_id: str):\n if item_id not in items:\n raise HTTPException(status_code=404, detail=\"Item not found\")\n return {\"item\": items[item_id]}\n ```\n \"\"\"\n\n def __init__(\n self,\n status_code: Annotated[\n int,\n Doc(\n \"\"\"\n HTTP status code to send to the client.\n \"\"\"\n ),\n ],\n detail: Annotated[\n Any,\n Doc(\n \"\"\"\n Any data to be sent to the client in the `detail` key of the JSON\n response.\n \"\"\"\n ),\n ] = None,\n headers: Annotated[\n Optional[dict[str, str]],\n Doc(\n \"\"\"\n Any headers to send to the client in the response.\n |