[ty] Right-hand side narrowing for if Foo is type(x) expressions by AlexWaygood · Pull Request #22608 · astral-sh/ruff (original) (raw)
mypy_primer results
Changes were detected when running on open source projects
xarray (https://github.com/pydata/xarray)
- xarray/tests/test_variable.py:2753:53: warning[possibly-missing-attribute] Attribute
dtypemay be missing on object of typeUnknown | list[Unknown | list[Unknown | int]] | DataFrame - Found 1763 diagnostics
- Found 1762 diagnostics
prefect (https://github.com/PrefectHQ/prefect)
- src/integrations/prefect-dbt/prefect_dbt/core/settings.py:94:28: error[invalid-assignment] Object of type
T@resolve_block_document_references | int | dict[str, Any] | ... omitted 4 union elementsis not assignable todict[str, Any]
- src/integrations/prefect-dbt/prefect_dbt/core/settings.py:94:28: error[invalid-assignment] Object of type
T@resolve_block_document_references | dict[str, Any] | str | ... omitted 4 union elementsis not assignable todict[str, Any]
- src/integrations/prefect-dbt/prefect_dbt/core/settings.py:99:28: error[invalid-assignment] Object of type
int | T@resolve_variables | float | ... omitted 4 union elementsis not assignable todict[str, Any]
- src/integrations/prefect-dbt/prefect_dbt/core/settings.py:99:28: error[invalid-assignment] Object of type
T@resolve_variables | str | int | ... omitted 4 union elementsis not assignable todict[str, Any]
- src/prefect/cli/deploy/_core.py:86:21: error[invalid-assignment] Object of type
T@resolve_block_document_references | int | dict[str, Any] | ... omitted 4 union elementsis not assignable todict[str, Any]
- src/prefect/cli/deploy/_core.py:86:21: error[invalid-assignment] Object of type
T@resolve_block_document_references | dict[str, Any] | str | ... omitted 4 union elementsis not assignable todict[str, Any]
- src/prefect/cli/deploy/_core.py:87:21: error[invalid-assignment] Object of type
int | T@resolve_variables | float | ... omitted 4 union elementsis not assignable todict[str, Any]
- src/prefect/cli/deploy/_core.py:87:21: error[invalid-assignment] Object of type
T@resolve_variables | str | int | ... omitted 4 union elementsis not assignable todict[str, Any]
- src/prefect/deployments/steps/core.py:137:38: error[invalid-argument-type] Argument is incorrect: Expected
T@resolve_variables, foundT@resolve_block_document_references | int | dict[str, Any] | ... omitted 4 union elements
- src/prefect/deployments/steps/core.py:137:38: error[invalid-argument-type] Argument is incorrect: Expected
T@resolve_variables, foundT@resolve_block_document_references | dict[str, Any] | str | ... omitted 4 union elements
- src/prefect/utilities/templating.py:320:13: error[invalid-assignment] Invalid subscript assignment with key of type
objectand value of typeT@resolve_block_document_references | int | dict[str, Any] | ... omitted 4 union elementson object of typedict[str, Any]
- src/prefect/utilities/templating.py:320:13: error[invalid-assignment] Invalid subscript assignment with key of type
objectand value of typeT@resolve_block_document_references | dict[str, Any] | str | ... omitted 4 union elementson object of typedict[str, Any]
- src/prefect/utilities/templating.py:323:16: error[invalid-return-type] Return type does not match returned value: expected
T@resolve_block_document_references | dict[str, Any], foundlist[T@resolve_block_document_references | int | dict[str, Any] | ... omitted 5 union elements]
- src/prefect/utilities/templating.py:323:16: error[invalid-return-type] Return type does not match returned value: expected
T@resolve_block_document_references | dict[str, Any], foundlist[T@resolve_block_document_references | dict[str, Any] | str | ... omitted 5 union elements]
- src/prefect/utilities/templating.py:437:16: error[invalid-return-type] Return type does not match returned value: expected
T@resolve_variables, founddict[object, int | T@resolve_variables | float | ... omitted 5 union elements]
- src/prefect/utilities/templating.py:437:16: error[invalid-return-type] Return type does not match returned value: expected
T@resolve_variables, founddict[object, T@resolve_variables | str | int | ... omitted 5 union elements]
- src/prefect/utilities/templating.py:442:16: error[invalid-return-type] Return type does not match returned value: expected
T@resolve_variables, foundlist[int | T@resolve_variables | float | ... omitted 5 union elements]
- src/prefect/utilities/templating.py:442:16: error[invalid-return-type] Return type does not match returned value: expected
T@resolve_variables, foundlist[T@resolve_variables | str | int | ... omitted 5 union elements]
- src/prefect/workers/base.py:232:13: error[invalid-argument-type] Argument is incorrect: Expected
T@resolve_variables, foundT@resolve_block_document_references | int | dict[str, Any] | ... omitted 4 union elements
- src/prefect/workers/base.py:232:13: error[invalid-argument-type] Argument is incorrect: Expected
T@resolve_variables, foundT@resolve_block_document_references | dict[str, Any] | str | ... omitted 4 union elements
- src/prefect/workers/base.py:234:20: error[invalid-argument-type] Argument expression after ** must be a mapping type: Found
int | T@resolve_variables | float | ... omitted 4 union elements
- src/prefect/workers/base.py:234:20: error[invalid-argument-type] Argument expression after ** must be a mapping type: Found
T@resolve_variables | str | int | ... omitted 4 union elements
pandas (https://github.com/pandas-dev/pandas)
- pandas/tests/scalar/test_na_scalar.py:249:12: error[no-matching-overload] No overload matches arguments
- pandas/tests/scalar/test_na_scalar.py:250:14: error[no-matching-overload] No overload matches arguments
- pandas/tests/scalar/test_na_scalar.py:253:14: error[no-matching-overload] No overload matches arguments
- pandas/tests/scalar/test_na_scalar.py:275:14: error[no-matching-overload] No overload matches arguments
- Found 3756 diagnostics
- Found 3752 diagnostics
sympy (https://github.com/sympy/sympy)
- sympy/functions/elementary/tests/test_complexes.py:43:12: error[no-matching-overload] No overload of function
__new__matches arguments - sympy/functions/elementary/tests/test_complexes.py:45:12: error[no-matching-overload] No overload of function
__new__matches arguments - sympy/functions/elementary/tests/test_complexes.py:46:12: error[no-matching-overload] No overload of function
__new__matches arguments - sympy/functions/elementary/tests/test_complexes.py:211:12: error[unresolved-attribute] Object of type
imhas no attributeas_immutable - sympy/functions/elementary/tests/test_exponential.py:623:12: error[unresolved-attribute] Object of type
Exprhas no attributeepsilon_eq - sympy/functions/elementary/tests/test_exponential.py:625:12: error[unresolved-attribute] Object of type
Exprhas no attributeepsilon_eq - Found 15627 diagnostics
- Found 15621 diagnostics
static-frame (https://github.com/static-frame/static-frame)
- static_frame/core/bus.py:671:16: error[invalid-return-type] Return type does not match returned value: expected
InterGetItemLocReduces[Bus[Any], object_], foundInterGetItemLocReduces[Bus[Any] | Bottom[Index[Any]] | Bottom[Series[Any, Any]] | ... omitted 6 union elements, object_] - static_frame/core/bus.py:675:16: error[invalid-return-type] Return type does not match returned value: expected
InterGetItemILocReduces[Bus[Any], object_], foundInterGetItemILocReduces[Bus[Any] | Bottom[Index[Any]] | TypeBlocks | ... omitted 6 union elements, object_ | Self@iloc]
- static_frame/core/bus.py:675:16: error[invalid-return-type] Return type does not match returned value: expected
InterGetItemILocReduces[Bus[Any], object_], foundInterGetItemILocReduces[Self@iloc | Bus[Any], object_ | Self@iloc]
- static_frame/core/node_selector.py:526:16: error[invalid-return-type] Return type does not match returned value: expected
InterGetItemLocReduces[TVContainer_co@InterfaceSelectQuartet, Any], foundInterGetItemLocReduces[Bottom[Series[Any, Any]] | Unknown, Any]
- static_frame/core/node_selector.py:526:16: error[invalid-return-type] Return type does not match returned value: expected
InterGetItemLocReduces[TVContainer_co@InterfaceSelectQuartet, Any], foundInterGetItemLocReduces[Unknown | Bottom[Series[Any, Any]], Any] - static_frame/core/series.py:772:16: error[invalid-return-type] Return type does not match returned value: expected
InterGetItemILocReduces[Series[Any, Any], TVDtype@Series], foundInterGetItemILocReduces[Series[Any, Any] | Bottom[Index[Any]] | ndarray[Never, Never] | ... omitted 6 union elements, TVDtype@Series]
- static_frame/core/series.py:4072:16: error[invalid-return-type] Return type does not match returned value: expected
InterGetItemILocReduces[SeriesHE[Any, Any], TVDtype@SeriesHE], foundInterGetItemILocReduces[Bottom[Series[Any, Any]] | Bottom[Index[Any]] | TypeBlocks | ... omitted 7 union elements, TVDtype@SeriesHE] - static_frame/core/yarn.py:418:16: error[invalid-return-type] Return type does not match returned value: expected
InterGetItemILocReduces[Yarn[Any], object_], foundInterGetItemILocReduces[Yarn[Any] | ndarray[Never, Never] | TypeBlocks | ... omitted 6 union elements, object_] - Found 1824 diagnostics
- Found 1822 diagnostics
pandas-stubs (https://github.com/pandas-dev/pandas-stubs)
- tests/frame/test_groupby.py:229:15: error[type-assertion-failure] Type
Series[Any]does not match asserted typeSeries[str | bytes | int | ... omitted 12 union elements] - tests/frame/test_groupby.py:625:15: error[type-assertion-failure] Type
Series[Any]does not match asserted typeSeries[str | bytes | int | ... omitted 12 union elements] - Found 4353 diagnostics
- Found 4351 diagnostics
No memory usage changes detected ✅