Skip to content

REF: collect boilerplate in _datetimelike_compat #37723

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
Nov 10, 2020

Conversation

jbrockmendel
Copy link
Member

No description provided.

@@ -367,6 +367,32 @@ def _wrap_results(result, dtype: np.dtype, fill_value=None):
return result


def _datetimelike_compat(func):
Copy link
Contributor

Choose a reason for hiding this comment

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

FYI i don't think this needs to be private, but nbd.

Copy link
Member

Choose a reason for hiding this comment

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

also as a follow up need to ensure decorator preserves types #33455

Copy link
Member Author

Choose a reason for hiding this comment

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

will do follow-up to annotate new_func. can we start typing mask as np.ndarray[bool] or something like that?

Copy link
Member

Choose a reason for hiding this comment

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

The important thing is that the decoratored function signature is preserved. It may not be so important, in the grand scheme of things, to type check this function. though can do as well.

@jreback jreback added Clean Numeric Operations Arithmetic, Comparison, and Logical operations labels Nov 10, 2020
@jreback jreback added this to the 1.2 milestone Nov 10, 2020
@jreback jreback added the Datetime Datetime data dtype label Nov 10, 2020
@jreback jreback merged commit aa390ec into pandas-dev:master Nov 10, 2020
@jreback
Copy link
Contributor

jreback commented Nov 10, 2020

this is nice

@jbrockmendel jbrockmendel deleted the cln-wrap_reduction-2 branch November 10, 2020 03:32
jbrockmendel added a commit that referenced this pull request Nov 11, 2020
* TYP: nanops

* cast
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Clean Datetime Datetime data dtype Numeric Operations Arithmetic, Comparison, and Logical operations
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants