How to fix wrong pylance warning for pandas code in my vscode project?

I'm trying to keep my Python project in VSCode free of PyLance warnings. Unfortunately it looks like there's no complete typing information for Pandas objects. Here is a simple example:

This simple working code for creating a pandas Timestamp object:

ts = pd.Timestamp("2019-03-31 00:00:00") 

will give me the warning:

Arguments missing for parameters "month", "day" 

It looks like that the typing information for the Timestamp object does not know that it supports a string as parameter.

I know that I can turn it off with the # type:ignore comment:

ts = pd.Timestamp("2019-03-31 00:00:00")), # type: ignore 

I want to educate my interns to solve all typing warnings, so this is bad practice.

How can I configure these extra typing information and commit it to my project? Can I add my own type stubs to my project?

2

Reset to default

Know someone who can answer? Share a link to this question via email, Twitter, or Facebook.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like