From 12b7e1d96f9fc6ec63d8b17446dfa434393d18cf Mon Sep 17 00:00:00 2001 From: davem-bis <68955845+davem-bis@users.noreply.github.com> Date: Tue, 11 Aug 2026 15:25:49 +0100 Subject: [PATCH 1/2] Resolved starlette deprecation warnings. Signed-off-by: davem-bis <68955845+davem-bis@users.noreply.github.com> --- web/server/exceptions.py | 4 ++-- web/server/utils.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/web/server/exceptions.py b/web/server/exceptions.py index 8c62b0b005..21365b7f7d 100644 --- a/web/server/exceptions.py +++ b/web/server/exceptions.py @@ -3,7 +3,7 @@ import typing as t from fastapi import HTTPException -from starlette.status import HTTP_422_UNPROCESSABLE_ENTITY +from starlette.status import HTTP_422_UNPROCESSABLE_CONTENT from sqlmesh.utils.date import now_timestamp from web.server.models import ApiExceptionPayload @@ -14,7 +14,7 @@ def __init__( self, origin: str, message: str, - status_code: int = HTTP_422_UNPROCESSABLE_ENTITY, + status_code: int = HTTP_422_UNPROCESSABLE_CONTENT, trigger: t.Optional[str] = None, ): super().__init__(status_code) diff --git a/web/server/utils.py b/web/server/utils.py index 868425e76e..1ddebf764d 100644 --- a/web/server/utils.py +++ b/web/server/utils.py @@ -9,7 +9,7 @@ import pyarrow as pa # type: ignore from fastapi import Depends, HTTPException from starlette.responses import StreamingResponse -from starlette.status import HTTP_404_NOT_FOUND, HTTP_422_UNPROCESSABLE_ENTITY +from starlette.status import HTTP_404_NOT_FOUND, HTTP_422_UNPROCESSABLE_CONTENT from sqlmesh.core import constants as c from web.server.console import api_console @@ -45,7 +45,7 @@ def func_wrapper() -> R: message="An unexpected error occurred", origin="API -> utils -> run_in_executor", trigger="An unexpected error occurred", - status_code=HTTP_422_UNPROCESSABLE_ENTITY, + status_code=HTTP_422_UNPROCESSABLE_CONTENT, ) ) raise e From e293433225d784f34a084104caf1375212d1e885 Mon Sep 17 00:00:00 2001 From: davem-bis <68955845+davem-bis@users.noreply.github.com> Date: Fri, 21 Aug 2026 17:27:16 +0100 Subject: [PATCH 2/2] Bumped httpx to httpx2 to resolve starlette deprecation warning "StarletteDeprecationWarning: Using `httpx` with `starlette.testclient` is deprecated; install `httpx2` instead." Signed-off-by: davem-bis <68955845+davem-bis@users.noreply.github.com> --- pyproject.toml | 2 +- tests/web/test_main.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index bc12bc30ff..2c897de225 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -78,7 +78,7 @@ dev = [ "google-auth", "google-cloud-bigquery", "google-cloud-bigquery-storage", - "httpx", + "httpx2", "mypy~=1.13.0", "numpy", "pandas-stubs", diff --git a/tests/web/test_main.py b/tests/web/test_main.py index b20947c49d..69d0cd0449 100644 --- a/tests/web/test_main.py +++ b/tests/web/test_main.py @@ -7,7 +7,7 @@ import pytest from fastapi import FastAPI from fastapi.testclient import TestClient -from httpx import ASGITransport, AsyncClient +from httpx2 import ASGITransport, AsyncClient from pytest_mock.plugin import MockerFixture from sqlmesh.core.context import Context