This is an automated email from the ASF dual-hosted git repository.

potiuk pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git


The following commit(s) were added to refs/heads/main by this push:
     new 90deddd00c5 Fix Starlette 1.0.0 compatibility in TemplateResponse 
calls (#64116) (#64300)
90deddd00c5 is described below

commit 90deddd00c54b3f883f215a232fe1524e6f7236f
Author: Yu-Hong Shen <[email protected]>
AuthorDate: Fri Apr 3 02:42:38 2026 +0800

    Fix Starlette 1.0.0 compatibility in TemplateResponse calls (#64116) 
(#64300)
    
    Starlette 1.0.0 removed the deprecated TemplateResponse(name, context)
    signature where request was passed inside the context dict. Update both
    call sites to use the new signature TemplateResponse(request, name, context)
    and remove the temporary starlette<1 upper bound added in #64115.
    
    closes: #64116
    
    Co-authored-by: Yu-Hong Shen <[email protected]>
---
 airflow-core/pyproject.toml                                           | 4 +---
 .../airflow/api_fastapi/auth/managers/simple/simple_auth_manager.py   | 3 ++-
 airflow-core/src/airflow/api_fastapi/core_api/app.py                  | 3 ++-
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/airflow-core/pyproject.toml b/airflow-core/pyproject.toml
index 14e7bf266c4..5655d229a85 100644
--- a/airflow-core/pyproject.toml
+++ b/airflow-core/pyproject.toml
@@ -96,9 +96,7 @@ dependencies = [
     "dill>=0.2.2",
     "fastapi[standard-no-fastapi-cloud-cli]>=0.129.0",
     "uvicorn>=0.37.0",
-    # Starlette 1.0.0 breaks the API server. Needs more investigation
-    # https://github.com/apache/airflow/issues/64116
-    "starlette>=0.45.0,<1",
+    "starlette>=0.45.0",
     "httpx>=0.25.0",
     'importlib_metadata>=6.5;python_version<"3.12"',
     'importlib_metadata>=7.0;python_version>="3.12"',
diff --git 
a/airflow-core/src/airflow/api_fastapi/auth/managers/simple/simple_auth_manager.py
 
b/airflow-core/src/airflow/api_fastapi/auth/managers/simple/simple_auth_manager.py
index 0f89fd20c4c..a40915d5da8 100644
--- 
a/airflow-core/src/airflow/api_fastapi/auth/managers/simple/simple_auth_manager.py
+++ 
b/airflow-core/src/airflow/api_fastapi/auth/managers/simple/simple_auth_manager.py
@@ -354,8 +354,9 @@ class 
SimpleAuthManager(BaseAuthManager[SimpleAuthManagerUser]):
         @app.get("/{rest_of_path:path}", response_class=HTMLResponse, 
include_in_schema=False)
         def webapp(request: Request, rest_of_path: str):
             return templates.TemplateResponse(
+                request,
                 "/index.html",
-                {"request": request, "backend_server_base_url": 
request.base_url.path},
+                {"backend_server_base_url": request.base_url.path},
                 media_type="text/html",
             )
 
diff --git a/airflow-core/src/airflow/api_fastapi/core_api/app.py 
b/airflow-core/src/airflow/api_fastapi/core_api/app.py
index 2622aec86b9..16719e3f6d5 100644
--- a/airflow-core/src/airflow/api_fastapi/core_api/app.py
+++ b/airflow-core/src/airflow/api_fastapi/core_api/app.py
@@ -100,8 +100,9 @@ def init_views(app: FastAPI) -> None:
     @app.get("/{rest_of_path:path}", response_class=HTMLResponse, 
include_in_schema=False)
     def webapp(request: Request, rest_of_path: str):
         return templates.TemplateResponse(
+            request,
             "/index.html",
-            {"request": request, "backend_server_base_url": 
request.base_url.path},
+            {"backend_server_base_url": request.base_url.path},
             media_type="text/html",
         )
 

Reply via email to