[ty] Support basic narrowing with aliased conditional expressions#24302
Open
[ty] Support basic narrowing with aliased conditional expressions#24302
Conversation
Typing conformance resultsNo changes detected ✅Current numbersThe percentage of diagnostics emitted that were expected errors held steady at 86.61%. The percentage of expected errors that received a diagnostic held steady at 81.56%. The number of fully passing files held steady at 70/132. |
Memory usage reportSummary
Significant changesClick to expand detailed breakdownprefect
sphinx
trio
flake8
|
|
| Lint rule | Added | Removed | Changed |
|---|---|---|---|
unresolved-attribute |
1 | 37 | 1 |
invalid-argument-type |
1 | 24 | 1 |
not-subscriptable |
5 | 9 | 0 |
unused-type-ignore-comment |
13 | 0 | 0 |
no-matching-overload |
1 | 9 | 0 |
call-non-callable |
0 | 8 | 0 |
invalid-assignment |
2 | 4 | 2 |
invalid-return-type |
1 | 2 | 0 |
not-iterable |
0 | 3 | 0 |
redundant-cast |
3 | 0 | 0 |
unsupported-operator |
0 | 2 | 0 |
call-top-callable |
1 | 0 | 0 |
| Total | 28 | 98 | 4 |
Raw diff (130 changes)
CPython (cases_generator) (https://github.com/python/cpython)
- Tools/cases_generator/stack.py:738:13 error[invalid-assignment] Object of type `PointerOffset | None` is not assignable to attribute `memory_offset` on type `None | Local`
PyGithub (https://github.com/PyGithub/PyGithub)
+ github/Repository.py:2331:35 warning[unused-type-ignore-comment] Unused blanket `type: ignore` directive
+ github/Repository.py:4092:91 warning[unused-type-ignore-comment] Unused blanket `type: ignore` directive
bokeh (https://github.com/bokeh/bokeh)
- src/bokeh/plotting/_geo_feature.py:505:23 error[invalid-argument-type] Argument to function `len` is incorrect: Expected `Sized`, found `Unknown | None`
- src/bokeh/plotting/_geo_feature.py:521:40 error[not-subscriptable] Cannot subscript object of type `None` with no `__getitem__` method
core (https://github.com/home-assistant/core)
- homeassistant/components/tts/__init__.py:371:41 error[invalid-argument-type] Argument to bound method `write` is incorrect: Expected `bytes | bytearray | memoryview[int]`, found `object`
dd-trace-py (https://github.com/DataDog/dd-trace-py)
- ddtrace/appsec/_common_module_patches.py:355:9 error[unresolved-attribute] Attribute `downstream_requests` is not defined on `None` in union `ASM_Environment | None`
- ddtrace/vendor/psutil/__init__.py:1071:24 error[invalid-argument-type] Argument to function `sleep` is incorrect: Expected `SupportsIndex | float`, found `Unknown | None`
- ddtrace/vendor/psutil/__init__.py:1829:24 error[invalid-argument-type] Argument to function `sleep` is incorrect: Expected `SupportsIndex | float`, found `Unknown | None`
- ddtrace/vendor/psutil/__init__.py:1839:24 error[invalid-argument-type] Argument to function `sleep` is incorrect: Expected `SupportsIndex | float`, found `Unknown | None`
- ddtrace/vendor/psutil/__init__.py:1894:24 error[invalid-argument-type] Argument to function `sleep` is incorrect: Expected `SupportsIndex | float`, found `Unknown | None`
- ddtrace/vendor/psutil/__init__.py:1904:24 error[invalid-argument-type] Argument to function `sleep` is incorrect: Expected `SupportsIndex | float`, found `Unknown | None`
discord.py (https://github.com/Rapptz/discord.py)
- discord/app_commands/transformers.py:112:67 error[invalid-argument-type] Argument to bound method `_checked_translate` is incorrect: Expected `locale_str`, found `str | locale_str`
- discord/app_commands/transformers.py:117:67 error[invalid-argument-type] Argument to bound method `_checked_translate` is incorrect: Expected `locale_str`, found `str | locale_str`
- discord/ext/commands/view.py:151:53 error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `str`, found `str | None`
- discord/ext/commands/view.py:162:57 error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `str`, found `str | None`
+ discord/ext/commands/view.py:184:69 warning[unused-type-ignore-comment] Unused blanket `type: ignore` directive
ibis (https://github.com/ibis-project/ibis)
- ibis/backends/materialize/__init__.py:837:24 error[unresolved-attribute] Attribute `upper` is not defined on `None` in union `str | None`
- ibis/expr/api.py:1891:30 error[not-iterable] Object of type `Unknown | None` may not be iterable
- ibis/expr/api.py:1893:31 error[not-iterable] Object of type `Unknown | None` may not be iterable
- ibis/expr/api.py:1895:33 error[not-iterable] Object of type `Unknown | None` may not be iterable
jax (https://github.com/google/jax)
- jax/_src/pallas/mosaic_gpu/primitives.py:592:12 error[invalid-argument-type] Argument to function `len` is incorrect: Expected `Sized`, found `None | tuple[Unknown, ...]`
- jax/_src/pallas/mosaic_gpu/primitives.py:621:36 error[not-subscriptable] Cannot subscript object of type `None` with no `__getitem__` method
- jax/_src/pallas/mosaic_gpu/primitives.py:637:36 error[not-subscriptable] Cannot subscript object of type `None` with no `__getitem__` method
- jax/experimental/mosaic/gpu/tcgen05.py:452:8 error[unresolved-attribute] Attribute `shape` is not defined on `None` in union `TMEMRef | None`
- jax/experimental/mosaic/gpu/tcgen05.py:455:19 error[unresolved-attribute] Attribute `shape` is not defined on `None` in union `TMEMRef | None`
- jax/experimental/mosaic/gpu/tcgen05.py:457:8 error[unresolved-attribute] Attribute `dtype` is not defined on `None` in union `TMEMRef | None`
- jax/experimental/mosaic/gpu/tcgen05.py:460:15 error[unresolved-attribute] Attribute `dtype` is not defined on `None` in union `TMEMRef | None`
+ jax/experimental/mosaic/gpu/tcgen05.py:517:74 warning[unused-type-ignore-comment] Unused blanket `type: ignore` directive
meson (https://github.com/mesonbuild/meson)
- mesonbuild/compilers/detect.py:1168:73 error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `str | list[str]`, found `None | str | list[str]`
- mesonbuild/compilers/detect.py:1166:38 error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `str`, found `Unknown | str | None`
+ mesonbuild/compilers/detect.py:1166:38 error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `str`, found `str | None`
mitmproxy (https://github.com/mitmproxy/mitmproxy)
- test/mitmproxy/proxy/tutils.py:187:13 error[unresolved-attribute] Object of type `Command | Event` has no attribute `data`
more-itertools (https://github.com/more-itertools/more-itertools)
- more_itertools/more.py:4668:13 error[call-non-callable] Object of type `None` is not callable
- more_itertools/more.py:4692:13 error[call-non-callable] Object of type `None` is not callable
- more_itertools/more.py:4746:13 error[call-non-callable] Object of type `None` is not callable
- more_itertools/recipes.py:485:13 error[call-non-callable] Object of type `None` is not callable
mypy (https://github.com/python/mypy)
+ mypy/checkmember.py:1273:31 warning[redundant-cast] Value is already of type `Decorator`
+ mypy/checkmember.py:1302:24 warning[redundant-cast] Value is already of type `Decorator`
operator (https://github.com/canonical/operator)
+ ops/model.py:3700:16 warning[redundant-cast] Value is already of type `bool`
pandas (https://github.com/pandas-dev/pandas)
+ pandas/core/arrays/categorical.py:176:53 error[invalid-argument-type] Argument to function `invalid_comparison` is incorrect: Expected `ExtensionArray | ndarray[tuple[Any, ...], dtype[Any]] | list[Unknown] | ... omitted 14 union elements`, found `Hashable`
- pandas/core/construction.py:357:31 error[unresolved-attribute] Attribute `dtype` is not defined on `Sequence[object] & ~MaskedArray[tuple[object, ...], dtype[object]]` in union `(Sequence[object] & ~MaskedArray[tuple[object, ...], dtype[object]]) | (ExtensionArray & ~MaskedArray[tuple[object, ...], dtype[object]]) | ndarray[tuple[Any, ...], dtype[Any]] | (Index & ~MaskedArray[tuple[object, ...], dtype[object]]) | (Series & ~MaskedArray[tuple[object, ...], dtype[object]])`
- pandas/core/generic.py:8289:44 error[unsupported-operator] Unary operator `~` is not supported for object of type `ExtensionArray | ndarray[tuple[Any, ...], dtype[Any]] | Unknown`
pandera (https://github.com/pandera-dev/pandera)
- pandera/inspection_utils.py:14:37 error[unresolved-attribute] Object of type `(...) -> Unknown` has no attribute `__self__`
prefect (https://github.com/PrefectHQ/prefect)
- src/integrations/prefect-bitbucket/prefect_bitbucket/repository.py:123:21 error[unresolved-attribute] Attribute `get_secret_value` is not defined on `None` in union `SecretStr | None`
- src/integrations/prefect-bitbucket/prefect_bitbucket/repository.py:123:21 error[unresolved-attribute] Attribute `token` is not defined on `None` in union `BitBucketCredentials | None`
- src/integrations/prefect-bitbucket/prefect_bitbucket/repository.py:124:24 error[unresolved-attribute] Attribute `username` is not defined on `None` in union `BitBucketCredentials | None`
- src/integrations/prefect-dbt/prefect_dbt/core/_orchestrator.py:1289:28 error[unsupported-operator] Operator `in` is not supported between objects of type `Literal["execution_time"]` and `Unknown | None`
- src/integrations/prefect-dbt/prefect_dbt/core/_orchestrator.py:1290:71 error[not-subscriptable] Cannot subscript object of type `None` with no `__getitem__` method
- src/prefect/utilities/pydantic.py:192:5 error[invalid-assignment] Object of type `def __init__(__pydantic_self__: M@add_type_dispatch, **data: Any) -> None` is not assignable to attribute `__init__` of type `Overload[(self, o: object, /) -> None, (self, name: str, bases: tuple[type, ...], dict: dict[str, Any], /, **kwds: Any) -> None]`
+ src/prefect/utilities/pydantic.py:192:5 error[invalid-assignment] Object of type `def __init__(__pydantic_self__: M@add_type_dispatch, **data: Any) -> None` is not assignable to attribute `__init__` on type `type[M@add_type_dispatch] & ~<Protocol with members '__dispatch_key__'>`
- src/prefect/utilities/pydantic.py:193:5 error[invalid-assignment] Object of type `def __new__(cls: type[M@add_type_dispatch], **kwargs: Any) -> M@add_type_dispatch` is not assignable to attribute `__new__` of type `def __new__(mcs, cls_name: str, bases: tuple[type[Any], ...], namespace: dict[str, Any], __pydantic_generic_metadata__: PydanticGenericMetadata | None = None, __pydantic_reset_parent_namespace__: bool = True, _create_model_module: str | None = None, **kwargs: Any) -> type`
+ src/prefect/utilities/pydantic.py:193:5 error[invalid-assignment] Object of type `def __new__(cls: type[M@add_type_dispatch], **kwargs: Any) -> M@add_type_dispatch` is not assignable to attribute `__new__` on type `type[M@add_type_dispatch] & ~<Protocol with members '__dispatch_key__'>`
pytest (https://github.com/pytest-dev/pytest)
- src/_pytest/runner.py:127:27 error[unresolved-attribute] Object of type `Item` has no attribute `_request`
- src/_pytest/runner.py:130:9 error[unresolved-attribute] Object of type `Item` has no attribute `_initrequest`
+ src/_pytest/runner.py:130:9 error[unresolved-attribute] Object of type `Item & <Protocol with members '_request'>` has no attribute `_initrequest`
- src/_pytest/runner.py:146:9 error[unresolved-attribute] Unresolved attribute `_request` on type `Item`
+ src/_pytest/runner.py:146:9 error[invalid-assignment] Object of type `Literal[False]` is not assignable to attribute `_request` on type `Item & <Protocol with members '_request'>`
- src/_pytest/runner.py:147:9 error[unresolved-attribute] Unresolved attribute `funcargs` on type `Item`
+ src/_pytest/runner.py:147:9 error[invalid-assignment] Object of type `None` is not assignable to attribute `funcargs` on type `Item & <Protocol with members '_request'>`
rotki (https://github.com/rotki/rotki)
+ rotkehlchen/chain/evm/names.py:63:94 warning[unused-type-ignore-comment] Unused blanket `type: ignore` directive
+ rotkehlchen/chain/evm/names.py:67:73 warning[unused-type-ignore-comment] Unused blanket `type: ignore` directive
- rotkehlchen/chain/zksync_lite/manager.py:646:39 error[invalid-argument-type] Argument to bound method `append` is incorrect: Expected `tuple[int, HistoryEventType, HistoryEventSubType, Asset, FVal, ChecksumAddress, ChecksumAddress | None, str]`, found `tuple[Literal[0], Literal[HistoryEventType.WITHDRAWAL], Literal[HistoryEventSubType.BRIDGE], Asset, FVal, ChecksumAddress | None, None, str]`
- rotkehlchen/chain/zksync_lite/manager.py:700:39 error[invalid-argument-type] Argument to bound method `append` is incorrect: Expected `tuple[int, HistoryEventType, HistoryEventSubType, Asset, FVal, ChecksumAddress, ChecksumAddress | None, str]`, found `tuple[Literal[0], Literal[HistoryEventType.RECEIVE], Literal[HistoryEventSubType.NONE], Asset, FVal, ChecksumAddress | None, ChecksumAddress, str]`
+ rotkehlchen/tests/api/test_ens.py:62:94 warning[unused-type-ignore-comment] Unused blanket `type: ignore` directive
+ rotkehlchen/tests/api/test_ens.py:66:73 warning[unused-type-ignore-comment] Unused blanket `type: ignore` directive
scikit-learn (https://github.com/scikit-learn/scikit-learn)
- sklearn/compose/_column_transformer.py:1085:29 error[unresolved-attribute] Object of type `Self@transform` has no attribute `feature_names_in_`
+ sklearn/compose/_column_transformer.py:1085:29 error[not-subscriptable] Cannot subscript object of type `object` with no `__getitem__` method
- sklearn/decomposition/_dict_learning.py:2321:23 error[no-matching-overload] No overload matches arguments
- sklearn/decomposition/_dict_learning.py:2322:23 error[no-matching-overload] No overload matches arguments
- sklearn/ensemble/_hist_gradient_boosting/gradient_boosting.py:786:32 error[unresolved-attribute] Attribute `shape` is not defined on `None` in union `Unknown | None`
- sklearn/externals/array_api_extra/_lib/_utils/_helpers.py:194:16 error[invalid-return-type] Return type does not match returned value: expected `tuple[Array, Array]`, found `tuple[Array | int | float | complex, Array | int | float | complex]`
- sklearn/linear_model/_ridge.py:252:22 error[no-matching-overload] No overload of function `atleast_1d` matches arguments
scipy (https://github.com/scipy/scipy)
- scipy/_lib/_util.py:274:23 error[invalid-argument-type] Method `__getitem__` of type `Overload[(index: SupportsIndex, /) -> Unknown, (index: slice[Any, Any, Any], /) -> tuple[Unknown, ...]]` cannot be called with key of type `None` on object of type `tuple[Unknown, ...]`
- scipy/integrate/tests/test_quadrature.py:539:15 error[no-matching-overload] No overload of function `broadcast_to` matches arguments
- scipy/interpolate/_fitpack_impl.py:130:9 error[invalid-assignment] Invalid subscript assignment with key of type `Literal["u"]` and value of type `Unknown | None` on object of type `dict[str, ndarray[tuple[Any, ...], dtype[Any]] | int]`
- scipy/interpolate/_fitpack_impl.py:132:35 error[not-subscriptable] Cannot subscript object of type `None` with no `__getitem__` method
- scipy/interpolate/_fitpack_impl.py:136:35 error[not-subscriptable] Cannot subscript object of type `None` with no `__getitem__` method
- scipy/ndimage/_morphology.py:940:9 error[no-matching-overload] No overload matches arguments
- scipy/ndimage/_morphology.py:941:9 error[no-matching-overload] No overload matches arguments
- scipy/ndimage/_morphology.py:1166:9 error[no-matching-overload] No overload matches arguments
- scipy/ndimage/_morphology.py:2382:12 error[unresolved-attribute] Attribute `dtype` is not defined on `None` in union `Unknown | None`
- scipy/ndimage/_morphology.py:2384:12 error[unresolved-attribute] Attribute `shape` is not defined on `None` in union `Unknown | None`
- scipy/ndimage/_morphology.py:2387:9 error[invalid-assignment] Cannot assign to a subscript on an object of type `None`
- scipy/ndimage/_morphology.py:2391:12 error[unresolved-attribute] Attribute `ndim` is not defined on `None` in union `Unknown | None | ndarray[tuple[Any, ...], Unknown]`
- scipy/ndimage/_morphology.py:2393:24 error[unresolved-attribute] Attribute `size` is not defined on `None` in union `Unknown | None | ndarray[tuple[Any, ...], Unknown]`
- scipy/ndimage/_morphology.py:2393:57 error[unresolved-attribute] Attribute `shape` is not defined on `None` in union `Unknown | None | ndarray[tuple[Any, ...], Unknown]`
- scipy/ndimage/_morphology.py:2398:10 error[not-subscriptable] Cannot subscript object of type `None` with no `__getitem__` method
- scipy/ndimage/_morphology.py:2398:10 error[not-subscriptable] Cannot subscript object of type `None` with no `__getitem__` method
- scipy/ndimage/_morphology.py:2407:16 error[unresolved-attribute] Attribute `dtype` is not defined on `None` in union `Unknown | None`
- scipy/ndimage/_morphology.py:2409:16 error[unresolved-attribute] Attribute `shape` is not defined on `None` in union `Unknown | None`
- scipy/ndimage/_morphology.py:2414:25 error[unresolved-attribute] Attribute `shape` is not defined on `None` in union `Unknown | None`
- scipy/ndimage/_morphology.py:2415:29 error[not-subscriptable] Cannot subscript object of type `None` with no `__getitem__` method
- scipy/ndimage/_morphology.py:2417:13 error[invalid-assignment] Cannot assign to a subscript on an object of type `None`
- scipy/ndimage/_morphology.py:2577:12 error[unresolved-attribute] Attribute `shape` is not defined on `None` in union `Unknown | None`
- scipy/ndimage/_morphology.py:2579:12 error[unresolved-attribute] Attribute `dtype` is not defined on `None` in union `Unknown | None`
- scipy/ndimage/_morphology.py:2587:49 error[unresolved-attribute] Attribute `dtype` is not defined on `None` in union `Unknown | None`
- scipy/ndimage/_morphology.py:2595:16 error[unresolved-attribute] Attribute `shape` is not defined on `None` in union `Unknown | None`
- scipy/ndimage/_morphology.py:2597:16 error[unresolved-attribute] Attribute `dtype` is not defined on `None` in union `Unknown | None`
+ scipy/optimize/_lsq/trf.py:235:19 error[not-subscriptable] Cannot subscript object of type `float` with no `__getitem__` method
+ scipy/optimize/_lsq/trf.py:235:19 error[not-subscriptable] Cannot subscript object of type `int` with no `__getitem__` method
+ scipy/optimize/_lsq/trf.py:285:23 error[not-subscriptable] Cannot subscript object of type `float` with no `__getitem__` method
+ scipy/optimize/_lsq/trf.py:285:23 error[not-subscriptable] Cannot subscript object of type `int` with no `__getitem__` method
- scipy/spatial/transform/_rigid_transform.py:1400:25 error[unresolved-attribute] Attribute `dtype` is not defined on `int`, `slice[Any, Any, Any]`, `EllipsisType`, `None`, `Buffer`, `_SupportsArray[dtype[Any]]`, `_NestedSequence[_SupportsArray[dtype[Any]]]`, `float`, `complex`, `str`, `_NestedSequence[int | float | complex | bytes | str]` in union `int | slice[Any, Any, Any] | EllipsisType | None | ArrayLike`
- scipy/spatial/transform/_rigid_transform.py:1402:36 error[unresolved-attribute] Attribute `dtype` is not defined on `int`, `slice[Any, Any, Any]`, `EllipsisType`, `None`, `Buffer`, `_SupportsArray[dtype[Any]]`, `_NestedSequence[_SupportsArray[dtype[Any]]]`, `float`, `complex`, `str`, `_NestedSequence[int | float | complex | bytes | str]` in union `int | slice[Any, Any, Any] | EllipsisType | None | ArrayLike`
- scipy/spatial/transform/_rotation.py:2219:25 error[unresolved-attribute] Object of type `int | slice[Any, Any, Any] | EllipsisType | None` has no attribute `dtype`
- scipy/spatial/transform/_rotation.py:2221:42 error[unresolved-attribute] Object of type `int | slice[Any, Any, Any] | EllipsisType | None` has no attribute `dtype`
- subprojects/array_api_extra/src/array_api_extra/_lib/_utils/_helpers.py:194:16 error[invalid-return-type] Return type does not match returned value: expected `tuple[Array, Array]`, found `tuple[Array | int | float | complex, Array | int | float | complex]`
scrapy (https://github.com/scrapy/scrapy)
- scrapy/core/spidermw.py:351:29 error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `Iterable[Unknown]`, found `Iterable[_T@_process_spider_output] | AsyncIterator[_T@_process_spider_output] | Iterable[Unknown] | AsyncIterator[Unknown]`
setuptools (https://github.com/pypa/setuptools)
- setuptools/_imp.py:42:24 error[invalid-argument-type] Argument to function `issubclass` is incorrect: Expected `type`, found `Unknown | Loader | None`
- setuptools/_imp.py:50:24 error[invalid-argument-type] Argument to function `issubclass` is incorrect: Expected `type`, found `Unknown | Loader | None`
- setuptools/_vendor/more_itertools/more.py:4671:13 error[call-non-callable] Object of type `None` is not callable
- setuptools/_vendor/more_itertools/more.py:4695:13 error[call-non-callable] Object of type `None` is not callable
- setuptools/_vendor/more_itertools/more.py:4749:13 error[call-non-callable] Object of type `None` is not callable
- setuptools/_vendor/more_itertools/recipes.py:540:13 error[call-non-callable] Object of type `None` is not callable
spack (https://github.com/spack/spack)
- lib/spack/spack/audit.py:422:25 error[no-matching-overload] No overload of bound method `join` matches arguments
- lib/spack/spack/package_base.py:1772:21 error[unresolved-attribute] Object of type `Self@do_patch` has no attribute `patch`
+ lib/spack/spack/package_base.py:1772:21 error[call-top-callable] Object of type `Top[(...) -> object]` is not safe to call; its signature is not known
sphinx (https://github.com/sphinx-doc/sphinx)
- sphinx/ext/imgmath.py:269:9 error[unresolved-attribute] Unresolved attribute `_imgmath_warned_latex` on type `StandaloneHTMLBuilder`
- sphinx/ext/imgmath.py:279:9 error[unresolved-attribute] Unresolved attribute `_imgmath_warned_image_translator` on type `StandaloneHTMLBuilder`
static-frame (https://github.com/static-frame/static-frame)
+ static_frame/core/container_util.py:1830:66 warning[unused-type-ignore-comment] Unused blanket `type: ignore` directive
+ static_frame/core/frame.py:7561:43 warning[unused-type-ignore-comment] Unused blanket `type: ignore` directive
+ static_frame/core/index_hierarchy.py:1880:77 warning[unused-type-ignore-comment] Unused blanket `type: ignore` directive
+ static_frame/core/loc_map.py:187:32 warning[unused-type-ignore-comment] Unused blanket `type: ignore` directive
- static_frame/core/util.py:1429:26 error[no-matching-overload] No overload matches arguments
+ static_frame/core/util.py:3092:65 warning[unused-type-ignore-comment] Unused blanket `type: ignore` directive
sympy (https://github.com/sympy/sympy)
+ sympy/solvers/solveset.py:3137:19 error[unresolved-attribute] Object of type `object` has no attribute `name`
+ sympy/solvers/solveset.py:3167:15 error[no-matching-overload] No overload of bound method `subs` matches arguments
- sympy/solvers/solveset.py:3129:25 error[invalid-argument-type] Argument to function `next` is incorrect: Expected `SupportsNext[Unknown]`, found `tuple[Unknown, ...] | (Unknown & <Protocol with members '__iter__'>)`
xarray (https://github.com/pydata/xarray)
- xarray/core/groupby.py:770:22 error[invalid-argument-type] Argument to bound method `_to_temp_dataset` is incorrect: Expected `DataArray`, found `T_Xarray@GroupBy`
- xarray/core/groupby.py:776:20 error[invalid-argument-type] Argument to bound method `_shuffle` is incorrect: Argument type `T_Xarray@GroupBy` does not satisfy upper bound `DataArray` of type variable `Self`
- xarray/core/groupby.py:776:20 error[invalid-argument-type] Argument to bound method `_shuffle` is incorrect: Argument type `T_Xarray@GroupBy` does not satisfy upper bound `Dataset` of type variable `Self`
- xarray/core/groupby.py:781:20 error[invalid-argument-type] Argument to bound method `_from_temp_dataset` is incorrect: Argument type `T_Xarray@GroupBy` does not satisfy upper bound `DataArray` of type variable `Self`
+ xarray/core/groupby.py:781:20 error[invalid-return-type] Return type does not match returned value: expected `T_Xarray@GroupBy`, found `DataArray`950c3e0 to
3a5a4b7
Compare
3a5a4b7 to
a59b9b9
Compare
Contributor
|
Thank you! I'm planning to take a look soon. |
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
Closes astral-sh/ty#719 (almost)
From #23937
A complete implementation is already available in #23937. However, due to the complexity of the mechanism, I decided to extract only the basic support. As explicitly stated in mdtest, this PR does not yet implement support for cross-scope alias narrowing and chained aliases.
Test Plan
new mdtest: narrow/aliased_conditions.md