Skip to content

ENH: validates boolean kwargs in DataFrame and Series methods #46938

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

Closed
wants to merge 8 commits into from

Conversation

Condielj
Copy link

@Condielj Condielj commented May 4, 2022

(First commit is an extra frame.py and the second is deleting it- all frame.py's are in the right place)

@pep8speaks
Copy link

Hello @Condielj! Thanks for opening this PR. We checked the lines you've touched for PEP 8 issues, and found:

Line 1386:5: E301 expected 1 blank line, found 0
Line 2019:89: E501 line too long (89 > 88 characters)
Line 2922:89: E501 line too long (114 > 88 characters)
Line 9720:89: E501 line too long (97 > 88 characters)

Line 5456:89: E501 line too long (132 > 88 characters)

Line 43:1: E302 expected 2 blank lines, found 1
Line 43:89: E501 line too long (523 > 88 characters)
Line 48:43: W292 no newline at end of file

Line 28:1: E302 expected 2 blank lines, found 1
Line 28:89: E501 line too long (418 > 88 characters)
Line 33:47: W292 no newline at end of file

Line 524:1: E302 expected 2 blank lines, found 1
Line 551:5: E306 expected 1 blank line before a nested definition, found 0
Line 558:52: W292 no newline at end of file

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.

ideally do this incrementally to make sure tests pass

@@ -125,6 +125,7 @@ Other enhancements
- Added ``validate`` argument to :meth:`DataFrame.join` (:issue:`46622`)
- A :class:`errors.PerformanceWarning` is now thrown when using ``string[pyarrow]`` dtype with methods that don't dispatch to ``pyarrow.compute`` methods (:issue:`42613`)
- Added ``numeric_only`` argument to :meth:`Resampler.sum`, :meth:`Resampler.prod`, :meth:`Resampler.min`, :meth:`Resampler.max`, :meth:`Resampler.first`, and :meth:`Resampler.last` (:issue:`46442`)
- Added validation of boolean kwargs in string series and DataFrame methods, along with tests (:issue:`16714`)
Copy link
Contributor

Choose a reason for hiding this comment

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

pls be very specific on which methods / kwargs are updated here a reader is not going to find this note useful.

Copy link
Contributor

Choose a reason for hiding this comment

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

i would also put this in the appropriate bug fix categories (even if you do multiple notes is ok)

@@ -518,3 +520,39 @@ def validate_insert_loc(loc: int, length: int) -> int:
if not 0 <= loc <= length:
raise IndexError(f"loc must be an integer between -{length} and {length}")
return loc

def validate_bool_kwargs_from_keywords(*keywords):
Copy link
Contributor

Choose a reason for hiding this comment

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

umm why cannot we juse call the existng validate_bool_kwarg? why make yet another function?

@jreback jreback added the Compat pandas objects compatability with Numpy or Python functions label May 8, 2022
@github-actions
Copy link
Contributor

github-actions bot commented Jun 8, 2022

This pull request is stale because it has been open for thirty days with no activity. Please update and respond to this comment if you're still interested in working on this.

@github-actions github-actions bot added the Stale label Jun 8, 2022
@mroeschke
Copy link
Member

Thanks for the pull request, but it appears to have gone stale. If interested in continuing, please merge in the main branch, address any review comments and/or failing tests, and we can reopen.

@mroeschke mroeschke closed this Jun 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Compat pandas objects compatability with Numpy or Python functions Stale
Projects
None yet
Development

Successfully merging this pull request may close these issues.

inplace kwarg must be of bool type, but other boolean kwargs don't have this restriction
4 participants