Skip to content
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

API: Timestamp/Timedelta resolution in __repr__ #49059

Open
Tracked by #46587
jbrockmendel opened this issue Oct 12, 2022 · 1 comment
Open
Tracked by #46587

API: Timestamp/Timedelta resolution in __repr__ #49059

jbrockmendel opened this issue Oct 12, 2022 · 1 comment
Labels
API Design Non-Nano datetime64/timedelta64 with non-nanosecond resolution Timedelta Timedelta data type Timestamp pd.Timestamp and associated methods

Comments

@jbrockmendel
Copy link
Member

jbrockmendel commented Oct 12, 2022

Discussed on today's call, in 2.0 Timestamp and Timedelta will support non-nanosecond resolutions, and this should probably be reflected in the repr, something like Timestamp("2016-01-01 10:24:11.012", reso="ms").

ATM it is possible to do eval(repr(ts)) on a Timestamp. If we want to maintain that, we'll need to add a reso keyword (or another name, we discussed "unit" but that conflicts with the existing unit keyword) to the constructors.

If we do add a reso keyword, it may make sense to add it to to_datetime, date_range, to_timedelta, timedelta_range. That would avoid the need to do reso-inference in those functions.

@jbrockmendel jbrockmendel added Bug Needs Triage Issue that has not been reviewed by a pandas team member labels Oct 12, 2022
@jreback
Copy link
Contributor

jreback commented Oct 12, 2022

adding reso to the constructors and repr lgtm

@mroeschke mroeschke added Timedelta Timedelta data type Non-Nano datetime64/timedelta64 with non-nanosecond resolution Timestamp pd.Timestamp and associated methods API Design and removed Bug Needs Triage Issue that has not been reviewed by a pandas team member labels Oct 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API Design Non-Nano datetime64/timedelta64 with non-nanosecond resolution Timedelta Timedelta data type Timestamp pd.Timestamp and associated methods
Projects
None yet
Development

No branches or pull requests

3 participants