-
-
Notifications
You must be signed in to change notification settings - Fork 125
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
BDay typing #755
Comments
We need to know the version of the stubs that you have installed and a more complete example that runs. To find the version of the stubs within VS Code, use this code from pandas._version import _stub_version Then in VS Code, put your mouse over |
Can reproduce on main: import datetime
from pandas.tseries.offsets import BDay
datetime.date(2023, 1, 1) + BDay(2)
datetime.date(2023, 1, 1) - BDay(2)
reveal_type(BDay(2) + datetime.date(2023, 1, 1)) # datetime.date but pd.Timestamp at runtime |
Technically it is correct because |
Thanks for confirming! |
Your are welcome to open a PR, the relevant file is https://github.com/pandas-dev/pandas-stubs/blob/main/pandas-stubs/_libs/tslibs/offsets.pyi It is best to make changes and run the CI ( I think the line |
I was using pylance to check types and the
date + BDay
stubs seems to be incorrectAll 3 (
__rsub__
,__add__
,__radd__
) should returnpd.Timestamp
, but instead they are inferred asdatetime.date
:microsoft/pylance-release#4631
The text was updated successfully, but these errors were encountered: