Fix Starlette 1.0.0 compatibility in TemplateResponse calls (#64116)#64121
Fix Starlette 1.0.0 compatibility in TemplateResponse calls (#64116)#64121VarunShukla07 wants to merge 2 commits 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)
|
|
tests are failing |
| # Starlette 1.0.0 breaks the API server. Needs more investigation | ||
| # https://github.com/apache/airflow/issues/64116 |
There was a problem hiding this comment.
We need to remove the comment too.
| # Starlette 1.0.0 breaks the API server. Needs more investigation | ||
| # https://github.com/apache/airflow/issues/64116 | ||
| "starlette>=0.45.0,<1", | ||
| "starlette>=1.0.0", |
There was a problem hiding this comment.
Is there a way to make it compatible with >=0.45.0 and not force an upgrade to >= 1.0.0 ?
|
It looks like the current change assumes only the Starlette 1.0 signature, This might be causing the CI failures, especially the "unhashable type: 'dict'" Would it make sense to make this backward compatible instead? For example, we could conditionally handle both signatures:
This would allow supporting both versions without forcing an upgrade. Also, it might be worth checking if any remaining TemplateResponse calls |
|
I think there are a couple of issues causing the CI failures here:
We probably need conditional handling based on Starlette version
Maybe we should:
This should also fix the "unhashable type: 'dict'" error seen in CI. |
|
Hi! I’m a new contributor and was exploring this issue. I see this PR updates TemplateResponse usage for Starlette 1.0.0. I’d love to help—are there any remaining issues, failing tests, or edge cases I can work on? Thanks! |
|
Converted to draft. PR isn't ready for another round of review. (un-addressed comments + CI failing) |
Updated TemplateResponse calls to use Starlette 1.0.0 new signature.
Starlette 1.0.0 was released on March 22, 2026 and removed the deprecated
TemplateResponse(name, context) signature. The request object must now be
passed as the first argument instead of inside the context dict.
This was causing the API server to crash with:
TypeError: unhashable type: 'dict'Changes:
fixes: #64116
Was generative AI tooling used to co-author this PR?
{pr_number}.significant.rst, in airflow-core/newsfragments. You can add this file in a follow-up commit after the PR is created so you know the PR number.