Skip to content

TYP: blocks #39543

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

Merged
merged 6 commits into from
Feb 1, 2021
Merged

TYP: blocks #39543

merged 6 commits into from
Feb 1, 2021

Conversation

jbrockmendel
Copy link
Member

No description provided.

@simonjayhawkins simonjayhawkins added the Typing type annotations, mypy/pyright type checking label Feb 1, 2021
@simonjayhawkins simonjayhawkins added this to the 1.3 milestone Feb 1, 2021
@jreback jreback merged commit 7abac27 into pandas-dev:master Feb 1, 2021
@jbrockmendel jbrockmendel deleted the typ-blocks branch February 1, 2021 23:53
@simonjayhawkins
Copy link
Member

new mypy errors with numpy 1.20

pandas/core/internals/blocks.py:252: error: Incompatible return value type (got "Union[ndarray, ExtensionArray]", expected "ndarray")  [return-value]
pandas/core/internals/blocks.py:1538: error: Value of type variable "ArrayLike" of "putmask_inplace" cannot be "Union[ndarray, ExtensionArray]"  [type-var]
pandas/core/internals/blocks.py:1886: error: Item "dtype[Any]" of "Union[dtype[Any], ExtensionDtype]" has no attribute "na_value"  [union-attr]
pandas/core/internals/blocks.py:1972: error: Argument 1 to "can_hold_element" has incompatible type "Union[dtype[Any], ExtensionDtype]"; expected "dtype[Any]"  [arg-type]
pandas/core/internals/blocks.py:2039: error: Incompatible return value type (got "Union[ndarray, ExtensionArray]", expected "ndarray")  [return-value]
pandas/core/internals/managers.py:925: error: Argument 1 to "get_values" of "Block" has incompatible type "Union[ExtensionDtype, str, dtype[Any], Type[object], None]"; expected "Union[dtype[Any], ExtensionDtype, None]"  [arg-type]

This is not a criticism. This has been the situation every time numpy types are added. more so recently with many PRs targeted at getting dtype function arguments typed.

Just wanted to highlight that it is preferable to get #39513 resolved soon. please weight in there with your thoughts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Typing type annotations, mypy/pyright type checking
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants