Skip to content

BUG: Handle unit count when converting from np.datetime64 #58915

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

Closed
wants to merge 1 commit into from

Conversation

rob-sil
Copy link
Contributor

@rob-sil rob-sil commented Jun 4, 2024

@rob-sil rob-sil requested a review from MarcoGorelli as a code owner June 4, 2024 12:33
@mroeschke mroeschke requested a review from jbrockmendel June 4, 2024 18:04
"""
returns the number of units of the dtype for a numpy datetime64 object.
"""
return (<PyDatetimeScalarObject*>obj).obmeta.num
Copy link
Member

Choose a reason for hiding this comment

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

What does number of units mean exactly? And is there a public way to get this - I am wary of relying up internals llike this

@jbrockmendel
Copy link
Member

I think this case is rare enough I’d rather not support it at all than support is inconsistently across the codebase. Iirc @seberg was thinking of deprecating it in numpy too

@seberg
Copy link
Contributor

seberg commented Jun 4, 2024

Yeah, I suspect very few use that really and unless someone would shout, I would be fine with deprecating it. I would also suspect NumPy also has bugs around it due to it having at least almost no users in practice.

@rob-sil
Copy link
Contributor Author

rob-sil commented Jun 5, 2024

Any interest in adding a warning or putting a note in the docs? Otherwise, I'll close this PR.

@mroeschke
Copy link
Member

Looks like there not much appetite for this change so closing

@mroeschke mroeschke closed this Jun 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BUG: numpy.datetime64 unit counts ignored
5 participants