Skip to content

BUG: Restrict Timestamp(nanosecond=...) to [0, 999] #48691

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

Merged
merged 3 commits into from
Sep 29, 2022

Conversation

mroeschke
Copy link
Member

@mroeschke mroeschke added Deprecate Functionality to remove in pandas Timestamp pd.Timestamp and associated methods labels Sep 21, 2022
@mroeschke mroeschke added this to the 1.6 milestone Sep 21, 2022
if nanosecond is None:
nanosecond = 0
elif not (999 >= nanosecond >= 0):
warnings.warn(
Copy link
Member

Choose a reason for hiding this comment

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

could we just fix these now? The -1 case at least looks very broken

Copy link
Member Author

Choose a reason for hiding this comment

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

Hmm probably could be okay for 2.0 API change. Technically 999 < nanosecond < int32_max works okay, but sure can fix it in one go.

@mroeschke mroeschke changed the title DEPR: Timestamp(nanoseconds>999) BUG: Restrict Timestamp(nanosecond=...) to [0, 999] Sep 22, 2022
@phofl phofl merged commit 80271b0 into pandas-dev:main Sep 29, 2022
@phofl
Copy link
Member

phofl commented Sep 29, 2022

thx @mroeschke

@mroeschke mroeschke deleted the depr/ts_nano_bound branch September 29, 2022 15:25
@mroeschke mroeschke modified the milestones: 1.6, 2.0 Oct 13, 2022
noatamir pushed a commit to noatamir/pandas that referenced this pull request Nov 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Deprecate Functionality to remove in pandas Timestamp pd.Timestamp and associated methods
Projects
None yet
3 participants