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
@jbrockmendel
Copy link
Member Author

@mroeschke the CI failures look unrelated, but im not seeing them on other PRs so im at a loss. any thoughts? (this is the last RC blocker)

@jorisvandenbossche
Copy link
Member

We already have

            elif (
                isinstance(tz, tzlocal)
                and is_platform_windows()
                and _offset in (QuarterEnd, BQuarterBegin, BQuarterEnd)
            ):
                request.applymarker(
                    pytest.mark.xfail(reason="After GH#49737 t.tzinfo is None on CI")
                )

in that test, so it seems we already encountered similar issues before. Given that, I think it would be fine to expand that xfail condition on the short term

@mroeschke
Copy link
Member

Yeah looks like we're hitting dateutil/dateutil#197 from dateutil. This exception is hit in _localize_tso which is marked noexcept

@jbrockmendel
Copy link
Member Author

Updated to expand xfail

@jbrockmendel
Copy link
Member Author

Green

@mroeschke mroeschke merged commit 8813faf into pandas-dev:main Dec 2, 2025
41 checks passed
@mroeschke
Copy link
Member

Thanks @jbrockmendel

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants