Skip to content

Refactored custom datetime functions #52634

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 1 commit into from
Apr 13, 2023

Conversation

WillAyd
Copy link
Member

@WillAyd WillAyd commented Apr 12, 2023

Takes some of our custom code out of the vendored numpy module and puts it in a capsule. date_conversions.c is custom and could argue it should entirely be put into the capsule, but didn't want to do that here.

The main motiviation is to make the work @jbrockmendel started in #51368 possible

@mroeschke mroeschke added Refactor Internal refactoring of code Internals Related to non-user accessible pandas implementation labels Apr 12, 2023
Copy link
Member

@jbrockmendel jbrockmendel left a comment

Choose a reason for hiding this comment

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

LGTM

@mroeschke mroeschke added this to the 2.1 milestone Apr 13, 2023
@mroeschke mroeschke merged commit b0ff10f into pandas-dev:main Apr 13, 2023
@mroeschke
Copy link
Member

Thanks @WillAyd

@WillAyd
Copy link
Member Author

WillAyd commented Apr 13, 2023

@jbrockmendel do you want to try #51368 again? I think the code you had there should translate perfectly into this

@jbrockmendel
Copy link
Member

My current thought/hope is that numpy will merge numpy/numpy#21199 and we'll get this function from them. If that falls through then I'll revisit #51368.

mroeschke pushed a commit to mroeschke/pandas that referenced this pull request Apr 13, 2023
@WillAyd WillAyd deleted the datetime-refactor branch April 13, 2023 20:54
@WillAyd
Copy link
Member Author

WillAyd commented Apr 13, 2023

Sounds good. Just keep in mind with that approach you won't ever be able to do what you were trying to do with using the DateTime API directly, so will just stick with the duck typing

mroeschke added a commit that referenced this pull request Apr 14, 2023
* BUG: dt.days for timedelta non-nano overflows int32

* Run precommit

* lint

* Address code check failures

* Add whatsnew

* PERF: numpy dtype checks (#52582)

* CLN: Use #pragma once instead of include guards (#52635)

Use #pragma once

* Refactored custom datetime functions (#52634)

refactored custom datetime functions

* BLD: Add DLL hashes to RECORD (#52556)

* CI: Remove ArrayManager job (#52637)

* DOC: Remove notes to old Python/package versions (#52640)

* STYLE sort whatsnew entries alphabeticaly, allow for trailing full stops (#52598)

* allow for trailing full stops in sort-whatsnew-entries hook

* sort alphabetically instead

---------

Co-authored-by: MarcoGorelli <>

* Fix redundant entries

* remove redundant entries

---------

Co-authored-by: jbrockmendel <[email protected]>
Co-authored-by: William Ayd <[email protected]>
Co-authored-by: Thomas Li <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Internals Related to non-user accessible pandas implementation Refactor Internal refactoring of code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants