Added compute method to raise error on use#8734
Conversation
|
Can one of the admins verify this patch? |
dask/dataframe/groupby.py
Outdated
| graph = HighLevelGraph.from_collections(name, dask, dependencies=dependencies) | ||
| return new_dd_object(graph, name, chunk(self._meta), self.obj.divisions) | ||
|
|
||
| def _compute(self): |
There was a problem hiding this comment.
I think this should just be compute and it should accept kwarg to match:
Lines 266 to 267 in bd8e8dc
| def _compute(self): | |
| def compute(self, **kwargs): |
There was a problem hiding this comment.
Why is it mandatory to accept kwargs please ?
There was a problem hiding this comment.
The idea is to match the compute method on the base class so that if someone accidentally calls gb.compute(scheduler="threads") for instance, they will get the NotImplementedError
|
ok to test |
|
Thanks for opening this @Dranaxel - I think with a few tweaks it will be good to go! |
|
It would also be great if you could add a test for this. Probably you can just add a few lines to this test: dask/dask/dataframe/tests/test_groupby.py Lines 103 to 123 in 2ed4545 |
Co-authored-by: Julia Signell <jsignell@gmail.com>
|
Thanks for taking this on @Dranaxel! I think this will really help people :) |
DataFrameGroupBy#8695pre-commit run --all-filesFirst (very) naive implementation of compute method