[ty] Preserve constrained TypeVar mappings at ** call sites#24452
[ty] Preserve constrained TypeVar mappings at ** call sites#24452charliermarsh wants to merge 5 commits intocharlie/td-unionfrom
Conversation
Typing conformance resultsNo changes detected ✅Current numbersThe percentage of diagnostics emitted that were expected errors held steady at 87.72%. The percentage of expected errors that received a diagnostic held steady at 82.85%. The number of fully passing files held steady at 74/132. |
Memory usage reportSummary
Significant changesClick to expand detailed breakdownprefect
|
|
| Lint rule | Added | Removed | Changed |
|---|---|---|---|
invalid-await |
40 | 0 | 0 |
missing-argument |
32 | 0 | 0 |
unknown-argument |
11 | 0 | 0 |
invalid-return-type |
1 | 0 | 6 |
invalid-argument-type |
0 | 2 | 1 |
| Total | 84 | 2 | 7 |
Changes in flaky projects detected. Raw diff output excludes flaky projects; see the HTML report for details.
Raw diff (51 changes)
bokeh (https://github.com/bokeh/bokeh)
+ src/bokeh/document/events.py:244:56 error[unknown-argument] Argument `attr` does not match any known parameter of bound method `__init__`
+ src/bokeh/document/events.py:244:56 error[unknown-argument] Argument `cols` does not match any known parameter of bound method `__init__`
+ src/bokeh/document/events.py:244:56 error[unknown-argument] Argument `data` does not match any known parameter of bound method `__init__`
+ src/bokeh/document/events.py:244:56 error[unknown-argument] Argument `kind` does not match any known parameter of bound method `__init__`
+ src/bokeh/document/events.py:244:56 error[unknown-argument] Argument `model` does not match any known parameter of bound method `__init__`
+ src/bokeh/document/events.py:244:56 error[unknown-argument] Argument `msg_data` does not match any known parameter of bound method `__init__`
+ src/bokeh/document/events.py:244:56 error[unknown-argument] Argument `msg_type` does not match any known parameter of bound method `__init__`
+ src/bokeh/document/events.py:244:56 error[unknown-argument] Argument `new` does not match any known parameter of bound method `__init__`
+ src/bokeh/document/events.py:244:56 error[unknown-argument] Argument `patches` does not match any known parameter of bound method `__init__`
+ src/bokeh/document/events.py:244:56 error[unknown-argument] Argument `rollover` does not match any known parameter of bound method `__init__`
+ src/bokeh/document/events.py:244:56 error[unknown-argument] Argument `title` does not match any known parameter of bound method `__init__`
core (https://github.com/home-assistant/core)
- homeassistant/components/aprilaire/coordinator.py:106:21 error[invalid-argument-type] Argument to bound method `async_update_device` is incorrect: Expected `DeviceEntryType | None | UndefinedType`, found `set[tuple[str, str]]`
- homeassistant/components/aprilaire/coordinator.py:106:21 error[invalid-argument-type] Argument to bound method `async_update_device` is incorrect: Expected `str | None | UndefinedType`, found `set[tuple[str, str]]`
- homeassistant/components/energy/data.py:786:20 error[invalid-return-type] Return type does not match returned value: expected `BatterySourceType`, found `dict[str, Unknown | str]`
+ homeassistant/components/energy/data.py:786:20 error[invalid-return-type] Return type does not match returned value: expected `BatterySourceType`, found `dict[str, PowerConfig | str]`
- homeassistant/components/energy/data.py:789:16 error[invalid-return-type] Return type does not match returned value: expected `BatterySourceType`, found `dict[str, Unknown | str]`
+ homeassistant/components/energy/data.py:789:16 error[invalid-return-type] Return type does not match returned value: expected `BatterySourceType`, found `dict[str, PowerConfig | str]`
- homeassistant/components/energy/data.py:804:20 error[invalid-return-type] Return type does not match returned value: expected `GridSourceType`, found `dict[str, Unknown | str]`
+ homeassistant/components/energy/data.py:804:20 error[invalid-return-type] Return type does not match returned value: expected `GridSourceType`, found `dict[str, int | float | str | None | PowerConfig]`
- homeassistant/components/energy/data.py:807:16 error[invalid-return-type] Return type does not match returned value: expected `GridSourceType`, found `dict[str, Unknown | str]`
+ homeassistant/components/energy/data.py:807:16 error[invalid-return-type] Return type does not match returned value: expected `GridSourceType`, found `dict[str, int | float | str | None | PowerConfig]`
graphql-core (https://github.com/graphql-python/graphql-core)
+ src/graphql/type/directives.py:133:16 error[missing-argument] No arguments provided for required parameters `name`, `locations` of bound method `__init__`
+ src/graphql/utilities/extend_schema.py:295:16 error[missing-argument] No arguments provided for required parameters `name`, `locations` of bound method `__init__`
+ src/graphql/utilities/extend_schema.py:333:23 error[missing-argument] No argument provided for required parameter `type_` of bound method `__init__`
+ src/graphql/utilities/extend_schema.py:352:16 error[missing-argument] No argument provided for required parameter `name` of function `__new__`
+ src/graphql/utilities/extend_schema.py:367:16 error[missing-argument] No argument provided for required parameter `name` of function `__new__`
+ src/graphql/utilities/extend_schema.py:384:16 error[missing-argument] No argument provided for required parameter `name` of function `__new__`
+ src/graphql/utilities/extend_schema.py:418:16 error[missing-argument] No argument provided for required parameter `name` of function `__new__`
+ src/graphql/utilities/extend_schema.py:457:16 error[missing-argument] No argument provided for required parameter `name` of function `__new__`
+ src/graphql/utilities/extend_schema.py:482:16 error[missing-argument] No argument provided for required parameter `name` of function `__new__`
+ src/graphql/utilities/extend_schema.py:492:16 error[missing-argument] No argument provided for required parameter `type_` of bound method `__init__`
+ src/graphql/utilities/extend_schema.py:502:16 error[missing-argument] No argument provided for required parameter `type_` of bound method `__init__`
+ src/graphql/type/definition.py:291:16 error[missing-argument] No argument provided for required parameter `name` of function `__new__`
+ src/graphql/type/definition.py:443:16 error[missing-argument] No argument provided for required parameter `name` of function `__new__`
+ src/graphql/type/definition.py:547:16 error[missing-argument] No argument provided for required parameter `type_` of bound method `__init__`
+ src/graphql/type/definition.py:693:16 error[missing-argument] No argument provided for required parameter `type_` of bound method `__init__`
+ src/graphql/type/definition.py:773:16 error[missing-argument] No argument provided for required parameter `name` of function `__new__`
+ src/graphql/type/definition.py:877:16 error[missing-argument] No argument provided for required parameter `name` of function `__new__`
+ src/graphql/type/definition.py:980:16 error[missing-argument] No argument provided for required parameter `name` of function `__new__`
+ src/graphql/type/definition.py:1115:16 error[missing-argument] No argument provided for required parameter `name` of function `__new__`
+ src/graphql/type/definition.py:1347:16 error[missing-argument] No argument provided for required parameter `name` of function `__new__`
+ src/graphql/type/definition.py:1444:16 error[missing-argument] No argument provided for required parameter `type_` of bound method `__init__`
+ src/graphql/utilities/lexicographic_sort_schema.py:67:16 error[missing-argument] No arguments provided for required parameters `name`, `locations` of bound method `__init__`
+ src/graphql/utilities/lexicographic_sort_schema.py:78:26 error[missing-argument] No argument provided for required parameter `type_` of bound method `__init__`
+ src/graphql/utilities/lexicographic_sort_schema.py:89:28 error[missing-argument] No argument provided for required parameter `type_` of bound method `__init__`
+ src/graphql/utilities/lexicographic_sort_schema.py:124:20 error[missing-argument] No argument provided for required parameter `name` of function `__new__`
+ src/graphql/utilities/lexicographic_sort_schema.py:132:20 error[missing-argument] No argument provided for required parameter `name` of function `__new__`
+ src/graphql/utilities/lexicographic_sort_schema.py:140:20 error[missing-argument] No argument provided for required parameter `name` of function `__new__`
+ src/graphql/utilities/lexicographic_sort_schema.py:144:20 error[missing-argument] No argument provided for required parameter `name` of function `__new__`
+ src/graphql/utilities/lexicographic_sort_schema.py:160:20 error[missing-argument] No argument provided for required parameter `name` of function `__new__`
+ tests/type/test_definition.py:1280:17 error[missing-argument] No argument provided for required parameter `name` of function `__new__`
pydantic (https://github.com/pydantic/pydantic)
- pydantic/_internal/_generate_schema.py:2886:16 error[invalid-return-type] Return type does not match returned value: expected `InvalidSchema | AnySchema | NoneSchema | ... omitted 49 union elements`, found `dict[str, Unknown | str]`
+ pydantic/_internal/_generate_schema.py:2886:16 error[invalid-return-type] Return type does not match returned value: expected `InvalidSchema | AnySchema | NoneSchema | ... omitted 49 union elements`, found `dict[str, int | list[str] | list[ArgumentsParameter] | ... omitted 91 union elements]`
- pydantic/types.py:1772:17 error[invalid-argument-type] Argument to function `no_info_after_validator_function` is incorrect: Expected `InvalidSchema | AnySchema | NoneSchema | ... omitted 49 union elements`, found `dict[str, Unknown | bool]`
+ pydantic/types.py:1772:17 error[invalid-argument-type] Argument to function `no_info_after_validator_function` is incorrect: Expected `InvalidSchema | AnySchema | NoneSchema | ... omitted 49 union elements`, found `dict[str, int | list[str] | list[ArgumentsParameter] | ... omitted 91 union elements]`
pyjwt (https://github.com/jpadilla/pyjwt)
- jwt/api_jwt.py:88:16 error[invalid-return-type] Return type does not match returned value: expected `FullOptions`, found `dict[str, Unknown]`
+ jwt/api_jwt.py:88:16 error[invalid-return-type] Return type does not match returned value: expected `FullOptions`, found `dict[Literal["enforce_minimum_key_length", "require", "strict_aud", "verify_aud", "verify_exp", ... omitted 6 literals], bool | list[str]]`
pylint (https://github.com/pycqa/pylint)
+ pylint/checkers/base_checker.py:207:16 error[missing-argument] No argument provided for required parameter `scope` of bound method `__init__`20dd156 to
085afc6
Compare
966da8d to
c3c3c39
Compare
|
|
We could decide that a permissive fallback (as we were doing before) is better here. I'm not sure. |
97e474c to
c168f53
Compare
c3c3c39 to
e6e1124
Compare
c168f53 to
adc2c96
Compare
e6e1124 to
f961d49
Compare
687c6b4 to
95f73c5
Compare
39d13a2 to
c58b08e
Compare
Summary
This PR improves support for
**kwargsin cases wherekwargsis a constrained TypeVar. We now compute the exact keys instead of falling back to the generic mapping case.