Skip to content

CI 1.4.x: Typing error Overload 2 for "searchsorted" will never be used because its parameters overlap overload 1 #47569

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
phofl opened this issue Jul 1, 2022 · 10 comments
Labels
CI Continuous Integration Typing type annotations, mypy/pyright type checking
Milestone

Comments

@phofl
Copy link
Member

phofl commented Jul 1, 2022

See https://github.com/pandas-dev/pandas/runs/7029429387?check_suite_focus=true

@phofl phofl added CI Continuous Integration Typing type annotations, mypy/pyright type checking labels Jul 1, 2022
@phofl phofl added this to the 1.4.4 milestone Jul 1, 2022
@twoertwein
Copy link
Member

Numpy 1.23.0 seems to be installed in this case which seems to be causing many other type issues.

@simonjayhawkins
Copy link
Member

once #47453 is merged we can deal with any residual typing errors.

@simonjayhawkins
Copy link
Member

once #47453 is merged we can deal with any residual typing errors.

we have not merged this.

Now looking at the mypy errors on 1.4.x, I think resolving them properly would maybe require some discussion.

Because the errors arise because the backport branch is using numpy 1.23.1 for typing validation and main is using the older numpy 1.22.4 for typing validation, I was hoping that it would become an issue on main and we could discuss the typing changes for that and backport whatever is needed to fix the typing issues on 1.4.x

I propose for now (4 weeks on) to get typing green on the backport branch to just add ignores (or whatever) where needed. It's (hopefully) the last of the patch releases so hopefully won't create too many (or even any) merge conflicts on future backports.

The codebase is not py.typed and so (imo) the type annotations in the code are not part of the release and the type annotations on main are the important ones for code robustness and consistency in development. We have pandas-stubs for public use.

@simonjayhawkins
Copy link
Member

of course, we could also pin numpy to 1.22.4 here on 1.4.x?

@simonjayhawkins
Copy link
Member

of course, we could also pin numpy to 1.22.4 here on 1.4.x?

if we did this, we should get "Success: no issues found in 1343 source files" so I don't think there are any residual mypy errors #47569 (comment) but maybe still the one in the OP.

@phofl
Copy link
Member Author

phofl commented Aug 4, 2022

I would be in favor of pinning numpy for the typing checks, should be the best solution here when taking everything into account

@simonjayhawkins
Copy link
Member

sure. let's do that then. The environment.yaml is used for building the released docs. But nbd if there are issues with building the docs as these can always be re-built and uploaded to the web server. So I think if we pin in numpy in environment.yaml, that should do it.

@twoertwein
Copy link
Member

Could also pin numba to implicitly pin numpy (as on main) but as soon as numba is compatible with a newer numpy we get lots of typing errors.

@simonjayhawkins
Copy link
Member

on main we have numba 0.55.2 and on 1.4.x we have numba 0.53.1. so not sure how the lower numba resolves to a higher numpy, so probably best (imo) to explicitly pin numpy since the mypy errors are from the numpy version rather than relying on environment resolution?

@simonjayhawkins
Copy link
Member

closed in #47967

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

No branches or pull requests

3 participants