Repository navigation
Conversation
Mixed activityActivity patterns show a mix of organic and automated signals. Evidence
This is an automated analysis by AgentScan |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #14573 +/- ##
===========================================
- Coverage 99.13% 48.23% -50.91%
===========================================
Files 135 135
Lines 54630 54622 -8
Branches 2808 2808
===========================================
- Hits 54158 26346 -27812
- Misses 357 27637 +27280
- Partials 115 639 +524
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. |
Confidence Score: 4/5
[Low impact] The change reaches type checking for request and response lookups using typed keys. The required API documentation update must be added before merging. Reviews (1) · Last reviewed commit: "Use the PR number for the change note" · Reviewed by Greptile |
Merging this PR will not alter performance1 warning
Comparing Footnotes
|
What do these changes do?
#11766 added
RequestKeyandResponseKeyand overloaded__getitem__and__setitem__onBaseRequestandStreamResponse. It did not overloadget(), sorequest.get(key)andresponse.get(key)fall back toMutableMapping.get()and returnAny, even for a typed key:This PR adds the same
get()overloads thatApplication.get()already has forAppKey:StreamResponse.get()gets the same overloads withResponseKey.Are there changes in behavior for the user?
No runtime change:
get()returnsself._state.get(key, default), which gives the same result as the inheritedMutableMapping.get(). Type checkers now inferT | None(orT | Uwith a default) for a typed key. String keys still giveAny.Is it a substantial burden for the maintainers to support this?
No. It copies the existing
Application.get()overloads. The existingtest_request_get_requestkeyandtest_response_get_responsekeytests now also haveassert_type()checks, so mypy fails if the types regress (6assert-typeerrors onmaster, none with this change).Related issue number
Follow-up to #11766 (issue #11762).
Checklist
CONTRIBUTORS.txtCHANGES/folder