Skip to content

TYP/cln: generic._make_*_function #32363

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

Conversation

topper-123
Copy link
Contributor

Give calls to these funcs named parameters for better clarity + type up the make_stats functions.

name2: str,
axis_descr: str,
desc: str,
func: Callable,
Copy link
Member

Choose a reason for hiding this comment

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

Is it possible to add subtypes here or no?

Copy link
Contributor Author

@topper-123 topper-123 Mar 1, 2020

Choose a reason for hiding this comment

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

The passed functions don't have the same signature, because e.g. nansum has a min_count parameter and nankurt does not. So it's not possible without splitting the function into two, which IMO is not worth it.

@jbrockmendel
Copy link
Member

LGTM

@jreback jreback added the Typing type annotations, mypy/pyright type checking label Mar 3, 2020
Copy link
Member

@WillAyd WillAyd left a comment

Choose a reason for hiding this comment

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

minor comment otherwise lgtm

@simonjayhawkins

accum_func: Callable,
accum_func_name: str,
mask_a: Union[float, np.floating],
mask_b: Union[float, np.floating],
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
mask_b: Union[float, np.floating],
mask_b: float,

@topper-123 topper-123 force-pushed the cln_generic_make_x_function branch from e120260 to 0c3db7f Compare March 4, 2020 07:03
@topper-123 topper-123 merged commit c5f0ebf into pandas-dev:master Mar 4, 2020
@topper-123 topper-123 deleted the cln_generic_make_x_function branch March 4, 2020 08:20
@topper-123 topper-123 added this to the 1.1 milestone Mar 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Typing type annotations, mypy/pyright type checking
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants