-
-
Notifications
You must be signed in to change notification settings - Fork 18.3k
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
Expand groupby dispatch whitelist (GH5480) #5604
Conversation
looks fine to me - @jreback any objections? I think this needs to end up in 0.13 |
my problem with this is we have a whitelist; by definition anything not on it is blacklist. not a big fan of listing all kinds of methods (bad enough that have it on whitelist), but going to be a problem as there are easy way to maintain this so why is there a blacklist? and not just disallow not on whitelist - I thought this pr was just going to add some methods to whitelist which is ok |
I however do like the idea of testing all methods on the whitelist (and hard coding in the test suite) so that if something is changed the test will fail (also should compare the whitelist to the defined whitelist) and then also test that not on whitelist will fail (with a sample of methods) |
remember that the worst case is something is left off of whitelist - you can still do it via apply not just automatic dispatch - as long as most common are on their it is fine |
@jreback, a blacklist was created to block access to some methods while deprecating access to others (my interpretation of the comments in #5480). In summary, the changes in this PR are:
Re: testing, I added a new commit to this PR with improved whitelist testing (the full whitelist is hard-coded in the test suite now and compared to the defined whitelist). Since some methods in the whitelist are unique to Series or DataFrame, the whitelist needed to be refactored a bit, but that should clean up erroneous tab completion results (i.e., dtype on a DataFrameGroupBy object). Let me know if I should back out changes 2 & 3, or if there are any other suggestions. |
I am -1 on blacklist; this is going to be impossible to maintain. users will see the error and see that they are using an unsupported access method. If a method which is not on the list and should be then it can be added (as you are doing in 1), otherwise apply can be used. so I would back out 2 & 3 (but leave in tests for non-whitelist methods) |
Ok, thanks @jreback. I've backed out 2 & 3, rebased, and squashed the commits. |
looks ok to me...@jtratner? |
can u add |
- Create separate whitelists for SeriesGroupBy and DataFrameGroupBy objects - Improve groupby whitelist testing
np. updated the pr to include cumcount in the whitelist. |
this looks ok..>@jtratner? |
Expand groupby dispatch whitelist (GH5480)
(and create a groupby dispatch blacklist)
closes #5480.