-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
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
Refactor/validate utils #43551
Conversation
zyc09
commented
Sep 13, 2021
- refactoring for ENH: consistency of input args for boundaries #40245
- tests added / passed
- Ensure all linting tests pass, see here for how to run them
- whatsnew entry
There was a problem hiding this 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.
pandas/util/_validators.py
Outdated
@@ -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): |
There was a problem hiding this comment.
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)
pandas/util/_validators.py
Outdated
return left_closed, right_closed | ||
|
||
|
||
def validate_inclusive(inclusive): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you type
pandas/util/_validators.py
Outdated
@@ -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]: |
There was a problem hiding this comment.
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]
pandas/util/_validators.py
Outdated
return left_closed, right_closed | ||
|
||
|
||
def validate_inclusive(inclusive: Any) -> tuple[bool, bool]: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here Optional[str]
There was a problem hiding this comment.
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
thanks @zyc09 very nice! |