Fix Starlette 1.0.0 compatibility in TemplateResponse calls (#64116)#64300
Open
syhstanley wants to merge 1 commit intoapache:mainfrom
Open
Fix Starlette 1.0.0 compatibility in TemplateResponse calls (#64116)#64300syhstanley wants to merge 1 commit intoapache:mainfrom
syhstanley wants to merge 1 commit intoapache:mainfrom
Conversation
|
Congratulations on your first Pull Request and welcome to the Apache Airflow community! If you have any issues or are unsure about any anything please check our Contributors' Guide (https://github.com/apache/airflow/blob/main/contributing-docs/README.rst)
|
1a1547e to
e93b19b
Compare
…4116) 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 apache#64115. closes: apache#64116
e93b19b to
c4f7892
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Starlette 1.0.0 removed the deprecated `TemplateResponse(name, context)`
signature where `request` was passed inside the context dict. This caused
the API server to crash with `TypeError: unhashable type: 'dict'` (HTTP 500)
whenever the SPA catch-all route or the simple auth manager UI was served.
Root cause: Both `core_api/app.py` and `simple_auth_manager.py` were
using the old signature:
Fix: Update to the current signature (supported since starlette 0.27.0,
so fully backward-compatible with our `>=0.45.0` minimum):
Also removes the temporary `starlette<1` upper bound added in #64115 and
its associated comment.
Tested locally with starlette 1.0.0:
airflow-core/tests/unit/api_fastapi/execution_api/test_app.py— 7/7 passed (includes the previously failingtest_access_api_contract)airflow-core/tests/unit/api_fastapi/auth/managers/simple/— 202/202 passedairflow-core/tests/unit/api_fastapi/core_api/test_security.py+ auth routes — 89/89 passedcloses: #64116
Was generative AI tooling used to co-author this PR?