-
-
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
Check incorrect when using a TimestampSeries and YearEnd from pandas.tseries.offsets #969
Comments
Can you provide a more complete example? |
I digged into that one as I remember having similar issues on a project but I was not able to fully reproduce with import pandas as pd
df = pd.DataFrame({"date": pd.bdate_range("2024-09-01", "2024-09-10")})
df["date"] = pd.to_datetime(df["date"])
vv = pd.bdate_range("2024-09-01", "2024-09-10")
vv + pd.tseries.offsets.YearEnd(0) which will raise the error: |
pandas-stubs/pandas-stubs/core/indexes/datetimes.pyi Lines 58 to 61 in 5177d67
Likely could be added here as pd.tseries.offsets.YearEnd is a class from the BaseOffset base class and not Timedelta .Open to discussing if this is the correct approach. |
Might be the same / similar as #755 |
Feel free to open a MR - I think this should work! |
Not sure it is exactly the same, maybe under the hood they are related but I could not find obvious ways to tackle those two at once. |
It seems type annotations are wrong between a Timestamp series and tools offered by the offsets library, using
pyright
df["year_end"] = df["date"] + pd.tseries.offsets.YearEnd(0) is flagged with Operator "+" not supported for types "TimestampSeries" and "YearEnd"
The text was updated successfully, but these errors were encountered: