-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
BUG: adds validation for boolean keywords in DataFrame.set_index #17853
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
BUG: adds validation for boolean keywords in DataFrame.set_index #17853
Conversation
Oh, and if people are happy with this decorator approach, I can go through and give all methods the same treatment/tests |
Just for reference, can you list 1 - 2 places where this also could be applied? Seems reasonable otherwise, though I would check performance just in the case the decorator imposes too much overhead. |
@gfyoung this could/(should according to @jreback #16714 (comment)) be applied to all boolean keyword arguments. So I could go through all of DataFrame, Series etc and decorate all methods with boolean kwargs |
@richardjgowers : Sure, though if you could specify a couple just for reference which take multiple boolean arguments, that would be great. |
can you rebase; move note to 0.22.0 |
c50ef50
to
9d22f46
Compare
Codecov Report
@@ Coverage Diff @@
## master #17853 +/- ##
=========================================
Coverage ? 91.21%
=========================================
Files ? 163
Lines ? 50048
Branches ? 0
=========================================
Hits ? 45650
Misses ? 4398
Partials ? 0
Continue to review full report at Codecov.
|
Codecov Report
@@ Coverage Diff @@
## master #17853 +/- ##
=========================================
Coverage ? 91.21%
=========================================
Files ? 163
Lines ? 50048
Branches ? 0
=========================================
Hits ? 45650
Misses ? 4398
Partials ? 0
Continue to review full report at Codecov.
|
9d22f46
to
6dd8308
Compare
ENH: Adds util._validators.validate_keywords_as_bool decorator
6dd8308
to
8c530dd
Compare
closing as stale, if you want to work on this, pls ping. |
ENH: Adds util._validators.validate_keywords_as_bool decorator
git diff upstream/master -u -- "*.py" | flake8 --diff
I've used a decorator so that we can check all the boolean kwargs at once rather than have a lot of lines of
validate_bool_kwarg
at the top of every method.