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

REF: avoid sanitize_to_nanoseconds #49009

Merged
merged 2 commits into from
Oct 10, 2022

Conversation

jbrockmendel
Copy link
Member

Most of the usages are unnecessary bc we go through the DTA/TDA constructors. After this there is only one left, and that will be removed by #48670

@mroeschke mroeschke added the Refactor Internal refactoring of code label Oct 10, 2022
# Timestamps like
# TODO 2022-10-08 we only have one test that gets here and
# values are already in nanoseconds in that case.
self.grouping_vector = Series(self.grouping_vector).to_numpy()
Copy link
Member

Choose a reason for hiding this comment

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

So Series(...).to_numpy() will coerce to nanos and then output to numpy? Is this a lot slower than sanitize_to_nanoseconds?

Copy link
Member Author

Choose a reason for hiding this comment

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

So Series(...).to_numpy() will coerce to nanos and then output to numpy?

Yes.

Is this a lot slower than sanitize_to_nanoseconds?

A bit. Adds about 65 microseconds.

Copy link
Member

Choose a reason for hiding this comment

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

Okay. I guess that's a fair tradeoff for being able to clean up sanitize_to_nanoseconds in #48670

@mroeschke mroeschke added the Datetime Datetime data dtype label Oct 10, 2022
@mroeschke mroeschke added this to the 1.6 milestone Oct 10, 2022
@mroeschke mroeschke merged commit 582377f into pandas-dev:main Oct 10, 2022
@mroeschke
Copy link
Member

Thanks @jbrockmendel

@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
* REF: avoid sanitize_to_nanoseconds

* fix test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Datetime Datetime data dtype Refactor Internal refactoring of code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants