-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
API: disable to_csv and friends on GroupBy objects #4887
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
Conversation
better than doing a whitelist? |
my hunch is that there are many more things to whitelist than blacklist |
i could be wrong.... |
so many things don't make sense e.g. abs,apply,shift,tshift,where,mask,align,groupby,clip....practially every method allowed of course: last,first,cum*,mean,sum,min,max,head,tail.... much smaller list |
@jreback merge? |
I would have your test try out some more methods? |
@jreback Anything else to add here? |
(type(self).__name__, attr)) | ||
|
||
def __getitem__(self, key): | ||
raise NotImplementedError | ||
|
||
def _make_wrapper(self, name): | ||
if name not in _apply_whitelist: | ||
raise AttributeError("%r object has no attribute %r" % | ||
(type(self).__name__, name)) |
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 make this a big more imformative, maybe ' This is a groupby object and cannot perform the operation ....`?, try use apply on tihs object.
okay improved the message .. good 2 go? |
looks good |
API: disable to_csv and friends on GroupBy objects
closes #4882 |
fyi, while testing pandas-master, hit a method not in the new groupby dispatch whitelist: Tried to generate a list of blacklisted methods for DataFrame and Series, see below -- needs further filtering, but may reveal useful blocked methods. any thoughts on the remaining methods?
|
@gdraps can you move this to a separate issue? |
Just to throw a spanner in the works here, I wonder if this is going to break existing code which uses this "feature" (i.e. user adds their own method to DataFrame then uses it on a groupby)... |
No description provided.