Skip to content

TYP: use DTypeLike alias from numpy.typing #41185

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

Closed
wants to merge 1 commit into from

Conversation

simonjayhawkins
Copy link
Member

No description provided.

@simonjayhawkins simonjayhawkins added the Typing type annotations, mypy/pyright type checking label Apr 27, 2021
Dtype = Union[
"ExtensionDtype", NpDtype, type_t[Union[str, float, int, complex, bool, object]]
]
Dtype = Union["ExtensionDtype", NpDtype]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we need to worry about strings like "categorical" that can be interpreted as pandas dtypes but not np.dtype?

@Dr-Irv
Copy link
Contributor

Dr-Irv commented Apr 28, 2021

@simonjayhawkins I hope you an approve and merge in #40421 before this one gets merged, because many of the changes there are with respect to using NpDtype in the right places with respect to the to_numpy() calls in ExtensionArray classes and subclasses.

@simonjayhawkins
Copy link
Member Author

@simonjayhawkins I hope you an approve and merge in #40421 before this one gets merged, because many of the changes there are with respect to using NpDtype in the right places with respect to the to_numpy() calls in ExtensionArray classes and subclasses.

I recall suggesting doing this as a precursor. some changes in #40421 would become unnecessary as the mypy errors are false postives.

@simonjayhawkins
Copy link
Member Author

closing to clear queue. will hopefully circle back to typing next week.

@simonjayhawkins simonjayhawkins mentioned this pull request Jun 1, 2021
4 tasks
@simonjayhawkins
Copy link
Member Author

@Dr-Irv @jbrockmendel I probably won't have time to revisit this for a while (probably after 1.3.1 to allow time to follow regressions from 1.3) so feel free to take this on.

@simonjayhawkins
Copy link
Member Author

I could be wrong, but I think this is necessary precursor to the EA typing work.

@jbrockmendel jbrockmendel added the Mothballed Temporarily-closed PR the author plans to return to label Jun 1, 2021
@Dr-Irv
Copy link
Contributor

Dr-Irv commented Jun 1, 2021

I could be wrong, but I think this is necessary precursor to the EA typing work.

I think you could do it in either order. If we can merge in the things I have been working on since late January, incorporating the changes in this PR will be straightforward. On the other hand, if we merge in this PR, then I probably have to make changes in my 4 open PRs, which would be a PITA.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Mothballed Temporarily-closed PR the author plans to return to Typing type annotations, mypy/pyright type checking
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants