Skip to content

API/DES: Non-Nanosecond Tracker #46587

Open
@jbrockmendel

Description

@jbrockmendel

Support for non-nanosecond timedelta64, datetime64, and datetime64tz is coming along. The next big planned steps are to get the Timedelta and Timestamp scalars to support non-nano resolutions. There are a few design options that I'd like to get input on cc @pandas-dev/pandas-core

I'm doing Timedelta first mostly because that is more conducive to doing as a scoped PR with dedicated testing. Current plan is to make a dedicated constructor like Timedelta._from_value_and_reso (so i can write tests) that can can be removed once we decide on the public behavior. Which brings us to the questions:

  • Do we add a reso-like keyword to the constructors? Or use/respect "unit"?
  • With non-nano np.timedelta64 objects that don't overflow when cast to nano, do we still cast? e.g. does `np.datetime64(4, "s") become ns or stay s?
  • Similar with pytimedelta. pd.Timedelta(timedelta(days=106752)) currently raises, in the future will presumably come back with a 'us' reso. So what about currently non-raising cases like pd.Timedelta(timedelta(days=106751))? Does it stay ns or become us?

Other

  1. What happens to (class attributes) (Timestamp|Timedelta)(min|max|resolution)?

Update 2023-01-16 Remaining TODO list

Metadata

Metadata

Assignees

No one assigned

    Labels

    API DesignNon-Nanodatetime64/timedelta64 with non-nanosecond resolution

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions