Use with Pandas?
#1466
-
Hello, I recently started to use Pyright on my projects, where I intensively use Pandas. If I understand correctly, Pandas does not have type stubs, so I get constant false positive errors like this:
Is there a solution for this? Can I fix somehow the type checking for Pandas, or at least disable type checking for Pandas entirely (but not for the rest of the code)? Thanks in advance! |
Beta Was this translation helpful? Give feedback.
Answered by
erictraut
Feb 9, 2021
Replies: 1 comment 5 replies
-
The pandas maintainers are working on incorporating types in an upcoming version of the library. Until then, you will need to do one of the following:
|
Beta Was this translation helpful? Give feedback.
5 replies
Answer selected by
dlozeve
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The pandas maintainers are working on incorporating types in an upcoming version of the library. Until then, you will need to do one of the following:
useLibraryCodeForTypes
setting (which I presume you've enabled). This will tell pyright not to attempt to infer types from library sources (a common source of false positives) and treat all types as "unknown" (Any
) when a type stub is not present. If your intent is to do type checking, this may be your only feasible option at this point. It will eliminate the false positives, but it…