Skip to content

subtracing a TimeStampSeries from a Timestamp not supported #1189

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 Apr 16, 2025 · 1 comment
Closed

subtracing a TimeStampSeries from a Timestamp not supported #1189

Dr-Irv opened this issue Apr 16, 2025 · 1 comment
Labels
good first issue Timedelta Code related to Timedelta Timestamp Cod related to pd.Timestamp

Comments

@Dr-Irv
Copy link
Collaborator

Dr-Irv commented Apr 16, 2025

Describe the bug
Type checking missing for Timestamp - TimestampSeries

To Reproduce

import pandas as pd
ts1 = pd.to_datetime(pd.Series(["2022-03-05", "2022-03-06"]))
assert isinstance(ts1.iloc[0], pd.Timestamp)
one_ts = ts1.iloc[0]
reveal_type(one_ts - ts1)

revealed type should be TimedeltaSeries.

Note that ts1 - one_ts works fine.

Need to add an overload in pandas-stubs/_libs/tslibs/timestamps.pyi

Please complete the following information:

  • OS: Windows
  • OS Version 11
  • python version 3.10
  • version of type checker pyright 1.386
  • version of installed pandas-stubs - development copy
@Dr-Irv Dr-Irv added good first issue Timestamp Cod related to pd.Timestamp Timedelta Code related to Timedelta labels Apr 16, 2025
@loicdiridollou
Copy link
Contributor

#1191

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Timedelta Code related to Timedelta Timestamp Cod related to pd.Timestamp
Projects
None yet
Development

No branches or pull requests

2 participants