Skip to content

Refactor/validate utils #43551

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 6 commits into from
Sep 14, 2021
Merged

Conversation

zyc09
Copy link
Contributor

@zyc09 zyc09 commented Sep 13, 2021

@jreback jreback added the Refactor Internal refactoring of code label Sep 13, 2021
@jreback jreback added this to the 1.4 milestone Sep 13, 2021
Copy link
Contributor

@jreback jreback left a comment

Choose a reason for hiding this comment

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

looks really code, some comments. ping on green.

@@ -427,3 +427,70 @@ def validate_ascending(
return validate_bool_kwarg(ascending, "ascending", **kwargs)

return [validate_bool_kwarg(item, "ascending", **kwargs) for item in ascending]


def validate_endpoints(closed):
Copy link
Contributor

Choose a reason for hiding this comment

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

can you type this (input & output)

return left_closed, right_closed


def validate_inclusive(inclusive):
Copy link
Contributor

Choose a reason for hiding this comment

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

can you type

@zyc09 zyc09 requested a review from jreback September 14, 2021 05:57
@@ -427,3 +428,70 @@ def validate_ascending(
return validate_bool_kwarg(ascending, "ascending", **kwargs)

return [validate_bool_kwarg(item, "ascending", **kwargs) for item in ascending]


def validate_endpoints(closed: Any) -> tuple[bool, bool]:
Copy link
Contributor

Choose a reason for hiding this comment

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

hmm this should be Optional[str]

return left_closed, right_closed


def validate_inclusive(inclusive: Any) -> tuple[bool, bool]:
Copy link
Contributor

Choose a reason for hiding this comment

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

same here Optional[str]

Copy link
Contributor Author

Choose a reason for hiding this comment

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

oof, let me amend that

@jreback jreback merged commit 7277952 into pandas-dev:master Sep 14, 2021
@jreback
Copy link
Contributor

jreback commented Sep 14, 2021

thanks @zyc09 very nice!

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

Successfully merging this pull request may close these issues.

2 participants