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

ENH/POC: infer resolution in array_strptime #55778

Merged
merged 3 commits into from
Nov 1, 2023

Conversation

jbrockmendel
Copy link
Member

array_strptime analogue to #55741, en route to #55564.

self.creso = item_reso
elif item_reso > self.creso:
self.creso = item_reso
self.creso_changed = True
Copy link
Member

Choose a reason for hiding this comment

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

So we only want to track if this changes once from the default? e.g.

>>> s = DatetimeParseState("s")
>>> s.update_creso("ms")
>>> s.update_creso("ms")
>>> s.creso_changed  # should still return True?

Copy link
Member Author

Choose a reason for hiding this comment

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

correct. this is a has-it-ever-changed-since-init

Copy link
Member

Choose a reason for hiding this comment

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

Gotcha. Could we rename this like creso_changed_from_default?

Copy link
Member Author

Choose a reason for hiding this comment

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

sure, will update

Copy link
Member Author

Choose a reason for hiding this comment

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

updated

@mroeschke mroeschke added the Non-Nano datetime64/timedelta64 with non-nanosecond resolution label Nov 1, 2023
@mroeschke mroeschke added this to the 2.2 milestone Nov 1, 2023
@mroeschke mroeschke merged commit d1b2c44 into pandas-dev:main Nov 1, 2023
34 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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants