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

TYP: Allow time manipulation functions to accept date and timedelta objects #20763

Merged
merged 1 commit into from Jan 8, 2022

Conversation

BvB93
Copy link
Member

@BvB93 BvB93 commented Jan 7, 2022

Backport of #20750


Closes #20746

The time manipulation functions (e.g. busday_count) are somewhat unique in that they unsafely cast many of their inputs to datetime64 or timedelta64 arrays. This unsafe casting means that the conventionally used npt.ArrayLike alias is not comprehensive enough to capture all valid input types, most notably excluding datetime.date and datetime.datetime.

This PR thus expands the relevant argument types with support for more datetime-based objects.

@BvB93 BvB93 added this to the 1.22.1 release milestone Jan 7, 2022
@charris charris merged commit 0b4f770 into numpy:maintenance/1.22.x Jan 8, 2022
@charris
Copy link
Member

charris commented Jan 8, 2022

Thanks Bas.

@BvB93 BvB93 deleted the datetime branch January 10, 2022 12:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants