[ty] Avoid eager TypedDict diagnostics in TypedDict | dict unions#24151
Merged
charliermarsh merged 1 commit intomainfrom Mar 24, 2026
Merged
[ty] Avoid eager TypedDict diagnostics in TypedDict | dict unions#24151charliermarsh merged 1 commit intomainfrom
TypedDict | dict unions#24151charliermarsh merged 1 commit intomainfrom
Conversation
Typing conformance resultsNo changes detected ✅Current numbersThe percentage of diagnostics emitted that were expected errors held steady at 85.38%. The percentage of expected errors that received a diagnostic held steady at 78.70%. The number of fully passing files held steady at 64/132. |
Memory usage reportMemory usage unchanged ✅ |
|
| Lint rule | Added | Removed | Changed |
|---|---|---|---|
invalid-key |
0 | 3 | 0 |
missing-typed-dict-key |
0 | 2 | 0 |
invalid-argument-type |
0 | 1 | 0 |
| Total | 0 | 6 | 0 |
Raw diff:
alerta (https://github.com/alerta/alerta)
- alerta/utils/logging.py:68:33 error[missing-typed-dict-key] Missing required key 'name' in TypedDict `_FilterConfigurationTypedDict` constructor
- alerta/utils/logging.py:69:25 error[invalid-key] Unknown key "()" for TypedDict `_FilterConfigurationTypedDict`
- alerta/utils/logging.py:70:25 error[invalid-key] Unknown key "methods" for TypedDict `_FilterConfigurationTypedDict`
- alerta/utils/logging.py:72:32 error[missing-typed-dict-key] Missing required key 'name' in TypedDict `_FilterConfigurationTypedDict` constructor
- alerta/utils/logging.py:73:25 error[invalid-key] Unknown key "()" for TypedDict `_FilterConfigurationTypedDict`
rotki (https://github.com/rotki/rotki)
- rotkehlchen/logging.py:209:20 error[invalid-argument-type] Invalid argument to key "filters" with declared type `dict[str, _FilterConfigurationTypedDict | dict[str, Any]]` on TypedDict `_DictConfigArgs`: value of type `dict[str, dict[str, <class 'PywsgiFilter'>]]`
Member
Author
|
I believe those were all false positives. |
82a5ed8 to
05306a6
Compare
carljm
approved these changes
Mar 24, 2026
carljm
added a commit
that referenced
this pull request
Mar 25, 2026
* main: [ty] Avoid eager TypedDict diagnostics in `TypedDict | dict` unions (#24151) `F507`: Fix false negative for non-tuple RHS in `%`-formatting (#24142) [ty] Update `SpecializationBuilder` hook to get both lower/upper bounds (#23848) Fix `%foo?` parsing in IPython assignment expressions (#24152) `E501`/`W505`/formatter: Exclude nested pragma comments from line width calculation (#24071) [ty] Fix Salsa panic propagation (#24141) [ty] Support `type:ignore[ty:code]` suppressions (#24096) [ty] Support narrowing for extended walrus targets (#24129)
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.
Summary
When a dict literal was inferred against a union containing both a TypedDict and a plain dict, we were validating too eagerly against the TypedDict arm and emitting false-positives (like
missing-typed-dict-key).