Skip to content

Commit fc2976a

Browse files
chore: Resolve starlette deprecation warnings (#5967)
Signed-off-by: davem-bis <68955845+davem-bis@users.noreply.github.com> Co-authored-by: Cortland Goffena <30168413+cmgoffena13@users.noreply.github.com>
1 parent 0317c1b commit fc2976a

4 files changed

Lines changed: 6 additions & 6 deletions

File tree

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ dev = [
7878
"google-auth",
7979
"google-cloud-bigquery",
8080
"google-cloud-bigquery-storage",
81-
"httpx",
81+
"httpx2",
8282
"mypy~=1.13.0",
8383
"numpy",
8484
"pandas-stubs",

tests/web/test_main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
import pytest
88
from fastapi import FastAPI
99
from fastapi.testclient import TestClient
10-
from httpx import ASGITransport, AsyncClient
10+
from httpx2 import ASGITransport, AsyncClient
1111
from pytest_mock.plugin import MockerFixture
1212

1313
from sqlmesh.core.context import Context

web/server/exceptions.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import typing as t
44

55
from fastapi import HTTPException
6-
from starlette.status import HTTP_422_UNPROCESSABLE_ENTITY
6+
from starlette.status import HTTP_422_UNPROCESSABLE_CONTENT
77

88
from sqlmesh.utils.date import now_timestamp
99
from web.server.models import ApiExceptionPayload
@@ -14,7 +14,7 @@ def __init__(
1414
self,
1515
origin: str,
1616
message: str,
17-
status_code: int = HTTP_422_UNPROCESSABLE_ENTITY,
17+
status_code: int = HTTP_422_UNPROCESSABLE_CONTENT,
1818
trigger: t.Optional[str] = None,
1919
):
2020
super().__init__(status_code)

web/server/utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
import pyarrow as pa # type: ignore
1010
from fastapi import Depends, HTTPException
1111
from starlette.responses import StreamingResponse
12-
from starlette.status import HTTP_404_NOT_FOUND, HTTP_422_UNPROCESSABLE_ENTITY
12+
from starlette.status import HTTP_404_NOT_FOUND, HTTP_422_UNPROCESSABLE_CONTENT
1313

1414
from sqlmesh.core import constants as c
1515
from web.server.console import api_console
@@ -45,7 +45,7 @@ def func_wrapper() -> R:
4545
message="An unexpected error occurred",
4646
origin="API -> utils -> run_in_executor",
4747
trigger="An unexpected error occurred",
48-
status_code=HTTP_422_UNPROCESSABLE_ENTITY,
48+
status_code=HTTP_422_UNPROCESSABLE_CONTENT,
4949
)
5050
)
5151
raise e

0 commit comments

Comments
 (0)