Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed a bug that results in incorrect type narrowing when using `isin… #8675

Merged
merged 1 commit into from
Aug 6, 2024

Conversation

erictraut
Copy link
Collaborator

…stance` with an instance of a generic class as the first argument and a concrete subclass as the filter type. This addresses #8672.

…stance` with an instance of a generic class as the first argument and a concrete subclass as the filter type. This addresses #8672.
Copy link
Contributor

github-actions bot commented Aug 6, 2024

Diff from mypy_primer, showing the effect of this PR on open source code:

spark (https://github.com/apache/spark)
+   /tmp/mypy_primer/projects/spark/python/pyspark/pandas/window.py:980:16 - error: Expression of type "FrameLike@RollingGroupby | DataFrame[Unknown]" is incompatible with return type "FrameLike@RollingGroupby"
+     Type "FrameLike@RollingGroupby | DataFrame[Unknown]" is incompatible with type "FrameLike@RollingGroupby" (reportReturnType)
- 24178 errors, 279 warnings, 0 informations 
+ 24179 errors, 279 warnings, 0 informations 

aioredis (https://github.com/aio-libs/aioredis)
+   /tmp/mypy_primer/projects/aioredis/aioredis/client.py:99:25 - error: Expression of type "list[str]" is incompatible with declared type "List[_KeyT@list_or_args | _ArgT@list_or_args]"
+     Type "str" is incompatible with type "_KeyT@list_or_args | _ArgT@list_or_args"
+       Type "str" is incompatible with type "_ArgT@list_or_args"
+       Type "str" is incompatible with type "_KeyT@list_or_args" (reportAssignmentType)
- 63 errors, 0 warnings, 0 informations 
+ 64 errors, 0 warnings, 0 informations 

streamlit (https://github.com/streamlit/streamlit)
+   /tmp/mypy_primer/projects/streamlit/lib/streamlit/dataframe_util.py:635:16 - error: Expression of type "list[int | str | V_co@convert_anything_to_sequence]" is incompatible with return type "Sequence[V_co@convert_anything_to_sequence]"
+     "list[int | str | V_co@convert_anything_to_sequence]" is incompatible with "Sequence[V_co@convert_anything_to_sequence]"
+       Type parameter "_T_co@Sequence" is covariant, but "int | str | V_co@convert_anything_to_sequence" is not a subtype of "V_co@convert_anything_to_sequence"
+         Type "int | str | V_co@convert_anything_to_sequence" is incompatible with type "V_co@convert_anything_to_sequence" (reportReturnType)
- 3423 errors, 144 warnings, 0 informations 
+ 3424 errors, 144 warnings, 0 informations 

@erictraut erictraut merged commit c1df659 into main Aug 6, 2024
18 checks passed
@erictraut erictraut deleted the issue-8672-2 branch August 6, 2024 16:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant