Skip to content

Missing addition for TimedeltaSeries plus TimestampSeries #460

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

Closed
Dr-Irv opened this issue Dec 7, 2022 · 0 comments · Fixed by #464
Closed

Missing addition for TimedeltaSeries plus TimestampSeries #460

Dr-Irv opened this issue Dec 7, 2022 · 0 comments · Fixed by #464
Labels
good first issue Timestamp Cod related to pd.Timestamp

Comments

@Dr-Irv
Copy link
Collaborator

Dr-Irv commented Dec 7, 2022

Describe the bug
We pick up TimestampSeries + TimedeltaSeries, but not the reverse.

To Reproduce

import pandas as pd

tds = pd.Series(pd.timedelta_range(start="1 day", periods=10))
tss = pd.Series(pd.date_range(start="2012-01-01", periods=10, freq="W-MON"))

plus= tds + tss
plus2 = tss + tds

The line with plus = tds + tss fails with pyright:

tdts.py:6:7 - error: Operator "+" not supported for types "TimedeltaSeries" and "TimestampSeries"
    Operator "+" not supported for types "TimedeltaSeries" and "TimestampSeries" (reportGeneralTypeIssues)

But the line with plus2 = tss + tds works.

Please complete the following information:

  • OS: Windows 10
  • python version: 3.9
  • pyright 1.1.283
  • version of installed pandas-stubs 1.5.2.221124

Additional context
Need to add TimestampSeries to the argument list here:

def __add__(self, other: Timestamp | DatetimeIndex) -> TimestampSeries: ...

@Dr-Irv Dr-Irv added good first issue Timestamp Cod related to pd.Timestamp labels Dec 7, 2022
Dr-Irv pushed a commit that referenced this issue Dec 12, 2022
* added 'TimestampSeries' in TimedeltaSeries in series.pyi

* added 'pd.Timestamp' as last argument to check

* changed the black version in pyproject.toml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Timestamp Cod related to pd.Timestamp
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant