-
-
Notifications
You must be signed in to change notification settings - Fork 114
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
Adding numpy as requirement for installation. (was adding numpy as requirement) #672
Comments
It's not pandas, it is numpy. You have to have numpy installed because we depend on the typing provided by numpy. I removed pandas from my environment, and your code passed. When I removed numpy, I then got the same error message. I think we will need to add numpy as a requirement. @twoertwein Your thoughts? |
I'm very hesitant to add (large) runtime dependencies to pandas-stubs. I believe we got the opposite issues when we had pandas/typing-extensions as a dependency. I think typeshed stubs do not(?) have dependencies. Does this error also happen with pyright? |
They do. If a typeshed stub package used numpy in its stubs, we'd add numpy as a dependency. |
Yes, same as with mypy. So pyright isn't seeing that the numpy referenced by an installed version of |
Although if you don't have |
I guess we should then make numpy a dependency (and theoretically all the other non-pandas libraries) |
Asking an obvious question here, but is there any context in which I don't know what the convention is, but I just pulled up |
Context is in the original part of the issue. Someone wanted to just do type checking using the stubs without installing any of the packages. |
If you mean me, at least from our site it would be totally fine to install numpy (or pandas). I just wanted to explain how we had an environment which has pandas-stubs but not pandas itself installed. |
FYI, |
Should we run mypy with |
It would then pick up that things like |
Describe the bug
Hey,
we have a environment where only linters are installed. After running
mypy .
we install all missing subs withmypy --install-types --non-interactive
.After running
mypy --ignore-missing-imports --disallow-any-generics --disallow-untyped-defs --no-implicit-optional --disallow-incomplete-defs .
we geht an error for accessing a series:Raises:
bug_minimal_example.py:5: error: "Series[Any]" not callable [operator]
Found 1 error in 1 file (checked 1 source file)
Error vanishes after numpy or pandas is installed.
To Reproduce
bug_minimal_example.py:5: error: "Series[Any]" not callable [operator]
Found 1 error in 1 file (checked 1 source file)
Please complete the following information:
pandas-stubs
: 2.0.1.230501Additional context
Suggested fix:
Adding pandas to requirements
The text was updated successfully, but these errors were encountered: