Skip to content

Conversation

cmp0xff
Copy link
Contributor

@cmp0xff cmp0xff commented Jul 12, 2025

@cmp0xff cmp0xff marked this pull request as ready for review July 12, 2025 21:49
Copy link
Member

@loicdiridollou loicdiridollou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall this is a lot of great work, I have taken a crack at it and was quickly under water with the amount of changes needed.
I believe the __add__ issue that you have seems similar to what I am experiencing with #1098 and you may have the same problem with __sub__ and __truediv__ but you will be able to confirm.
I think we can't let those slip in the current version. Maybe the option is to keep the current TimestampSeries definition as a middle layer and start supporting the Series[Timestamp] along the way (not sure if this is possible).

Copy link
Member

@twoertwein twoertwein left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for working on this!

(It might be too late for that, but it could be nice to split timedelta and timestamp into separate MRs.)

Overload order can be important when we have Series[Any] or Series[unknown]. After you get feedback from @Dr-Irv, it might be nice to add new tests for overloads that might have changed their any/unknown behavior.

cmp0xff added a commit to cmp0xff/pandas-stubs that referenced this pull request Jul 13, 2025
@cmp0xff cmp0xff force-pushed the hotfix/cmp0xff/gh718-drop-tss-tds branch from 5916fe1 to 3a27b71 Compare July 13, 2025 06:59
@cmp0xff cmp0xff marked this pull request as draft July 13, 2025 07:01
@cmp0xff
Copy link
Contributor Author

cmp0xff commented Jul 13, 2025

(It might be too late for that, but it could be nice to split timedelta and timestamp into separate MRs.)

I managed to isolate #1274 which just removes TimestampSeries. This PR can be reviewed after #1274.

@cmp0xff cmp0xff changed the title fix: #718 drop TimestampSeries and TimedeltaSeries fix: #718 also drop TimedeltaSeries Jul 13, 2025
@cmp0xff cmp0xff changed the title fix: #718 also drop TimedeltaSeries refactor: #718 also drop TimedeltaSeries Jul 13, 2025
@cmp0xff cmp0xff force-pushed the hotfix/cmp0xff/gh718-drop-tss-tds branch from 3a27b71 to dfd0dc5 Compare July 13, 2025 10:48
cmp0xff added a commit to cmp0xff/pandas-stubs that referenced this pull request Jul 16, 2025
cmp0xff added a commit to cmp0xff/pandas-stubs that referenced this pull request Jul 16, 2025
@cmp0xff cmp0xff force-pushed the hotfix/cmp0xff/gh718-drop-tss-tds branch 2 times, most recently from 6caa0c8 to 333eed7 Compare July 17, 2025 09:13
@cmp0xff cmp0xff force-pushed the hotfix/cmp0xff/gh718-drop-tss-tds branch from 333eed7 to 3df8ea0 Compare July 17, 2025 15:10
@Dr-Irv
Copy link
Collaborator

Dr-Irv commented Jul 24, 2025

So with this being dependent on #1274, I won't review this until that one is accepted and merged in.

cmp0xff added a commit to cmp0xff/pandas-stubs that referenced this pull request Jul 28, 2025
Dr-Irv pushed a commit that referenced this pull request Sep 17, 2025
* refactor: only drop TimestampSeries #1273 (review)

* fix(comment): https://github.com/pandas-dev/pandas-stubs/pull/1274/files#r2229555145

* less mypy ignore

* fix: even less mypy ignores

* refactor(comment): https://github.com/pandas-dev/pandas-stubs/pull/1274/files#r2229550572

* feat: sub

* fix(comment): https://github.com/pandas-dev/pandas-stubs/pull/1274/files#r2229581983

* fix: pyrefly

* fix(comment): https://github.com/pandas-dev/pandas-stubs/pull/1274/files#r2229580369

* fix(comment): #1274 (comment)

* fix(comment): #1274 (comment)

* fix(comment): #1274 (comment)

* fix: reduce ignore

* refactor: explain a temporary failure

* fix(comment): #1274 (comment)

* feat: arithmetic sub

* fix(comment): #1312 (comment)

* feat(comment): #1312 (comment)

* fix(comment): completeness #1312 (review)

* feat(series): arithmetic mul

* fix: type asserts

* feat: tests for addition

* fix(mypy): attempt for python > 310

* feat: tests for subtraction

* fix: pyright

* fix(comment): #1274 (comment)

* refactor: revert unused design

* feat: progressive philosophy

* fix(pytest): remove invalid tests

* fix: comment

* fix(comment): https://github.com/pandas-dev/pandas-stubs/pull/1274/files/f855f8655fcbc0c13879f404926034621641bc58#r2291133305

* fix(comment): #1274 (comment)

* chore(philosophy): first draft

* fix(pyright): median

* fix: comment

* fix(comment): #1274 (review)

* fix(comment): test_sub

* fix: typo
@cmp0xff cmp0xff force-pushed the hotfix/cmp0xff/gh718-drop-tss-tds branch from dbe65e4 to 89dd2f2 Compare September 21, 2025 17:18
@cmp0xff cmp0xff changed the title refactor: #718 also drop TimedeltaSeries refactor(series)!: ⏱️ drop TimedeltaSeries Sep 24, 2025
@cmp0xff cmp0xff marked this pull request as ready for review September 24, 2025 20:13
@cmp0xff
Copy link
Contributor Author

cmp0xff commented Sep 24, 2025

/pandas_nightly

@Dr-Irv I've finished it from my point of view. There are a lot of changes. How do we proceed? I also added Indexes to __mul__, __truediv__ and __floordiv__ because they already exist in the original TimedeltaSeries.

@Dr-Irv
Copy link
Collaborator

Dr-Irv commented Sep 24, 2025

@Dr-Irv I've finished it from my point of view. There are a lot of changes. How do we proceed? I also added Indexes to __mul__, truedivandfloordivbecause they already exist in the originalTimedeltaSeries`.

I'll review it and we'll take it from there.

Copy link
Collaborator

@Dr-Irv Dr-Irv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is looking pretty good. I would have preferred the changes for supporting floordiv and truediv, etc., that don't depend on Timedelta to be in a separate PR, but given how close this is to working, I don't want to add extra work for you.

Can you create an issue in pandas-stubs to create tests for arithmetic for TimedeltaIndex and DatetimeIndex, which should mirror the tests for pd.Series[Timedelta] and pd.Series[Timestamp], respecitvely?

numeric_only: _bool = False,
**kwargs: Any,
) -> float: ...
) -> S1: ...
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn't entirely correct, because pd.Series([1,2,3,4]).median() returns a float

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cmp0xff cmp0xff requested a review from Dr-Irv September 25, 2025 18:35
Copy link
Collaborator

@Dr-Irv Dr-Irv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only a few things

@cmp0xff cmp0xff requested a review from Dr-Irv September 26, 2025 09:04
Copy link
Collaborator

@Dr-Irv Dr-Irv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

figured out the to_numpy issue with mypy.

Would rather have median, mean and std return float on untyped Series as it is more user friendly that way.

@cmp0xff cmp0xff requested a review from Dr-Irv September 26, 2025 18:06
Copy link
Collaborator

@Dr-Irv Dr-Irv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks @cmp0xff major accomplishment!

@Dr-Irv Dr-Irv merged commit 7ac98f2 into pandas-dev:main Sep 26, 2025
13 checks passed
@Dr-Irv
Copy link
Collaborator

Dr-Irv commented Sep 26, 2025

@cmp0xff I have just released v2.3.2.250926 so we'll see what feedback we will get

@cmp0xff cmp0xff deleted the hotfix/cmp0xff/gh718-drop-tss-tds branch September 26, 2025 20:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants