Skip to content

Conversation

@jbrockmendel
Copy link
Member

  • closes #xxxx (Replace xxxx with the GitHub issue number)
  • Tests added and passed if fixing a bug or adding a new feature
  • All code checks passed.
  • Added type annotations to new arguments/methods/functions.
  • Added an entry in the latest doc/source/whatsnew/vX.X.X.rst file if fixing a bug or adding a new feature.
  • If I used AI to develop this pull request, I prompted it to follow AGENTS.md.

Discussed in today's dev meeting. There is one test that is currently failing but will pass once #63018 is merged

Copy link
Member

@jorisvandenbossche jorisvandenbossche left a comment

Choose a reason for hiding this comment

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

Looks good!

The actual Timedelta constructor with kwargs, is that tested much?
I was checking pandas/tests/scalar/timedelta/test_constructors.py, and there is test_td_constructor_on_nanoseconds, but maybe you could at least add an explicit test for Timedelta(nanoseconds=1000) still having nanoseconds, as well as something like Timedelta(microseconds=1.5) to cover the check whether to convert to microseconds or not?

+ seconds
+ seconds, "ns"
)
except OverflowError as err:
Copy link
Member

Choose a reason for hiding this comment

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

We should probably create some todo to try to parse to microseconds if this is out of bounds for nanoseconds?

Comment on lines +226 to +227
Timedelta(days=1).as_unit("ns"),
Timedelta(days=1).as_unit("ns").to_timedelta64(),
Copy link
Member

Choose a reason for hiding this comment

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

I was wondering why this would be needed, but I suppose it is because the expected will have ns. But now the array inference PR is merged, this change can be (or needs to be) reverted?

@jorisvandenbossche jorisvandenbossche added Timedelta Timedelta data type Non-Nano datetime64/timedelta64 with non-nanosecond resolution labels Dec 1, 2025
@jorisvandenbossche jorisvandenbossche added this to the 3.0 milestone Dec 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Non-Nano datetime64/timedelta64 with non-nanosecond resolution Timedelta Timedelta data type

2 participants