Allow split_out to be None, which then defaults to 1 in groupby().aggregate()#9491
Allow split_out to be None, which then defaults to 1 in groupby().aggregate()#9491jrbourbeau merged 3 commits intodask:mainfrom
split_out to be None, which then defaults to 1 in groupby().aggregate()#9491Conversation
jrbourbeau
left a comment
There was a problem hiding this comment.
Thanks @ian-r-rose! Would you mind adding a small test (e.g. similar to the example in #9490)?
|
Also, should we deprecate allowing |
I was a bit uncomfortable adding a test since I wasn't sure if we actually wanted to support |
|
Agreed, it'd be good to get thoughts from @wence- on his particular use case. That said, do we advertise anywhere that |
|
I only see Even then, it's saying it's an optional arg, which is a bit ambiguous. |
|
The implementation for |
That also has a bug :( ( |
I don't think it would be problematic. I noticed because in The maintenance issue here is somehow that there are lots of public APIs that call into the few "semi-private" APIs. So there are lots of places for the defaults to go out of whack. One way to partially solve this is to not provide default values for arguments to internal APIs, and promote the default handling to the public callers. I generally think that internal APIs should not do argument defaulting, since all that business logic handling is not really germane to the usage of the function. It does make calling these functions slightly more verbose (especially given that they all have many arguments), though one can utilise my favourite python argument list approach of required keyword-only args: |
If I ever have a week of nothing to do, I'd love to make 90% of the APIs here make use of keyword-only args. |
I am inclined to say yes. I will change things on the dask_cudf side. |
Discussion in dask/dask#9490 and dask/dask#9491 suggests that split_out=None as a default value was never really intended and is likely to be deprecated.
d8a1d11 to
80f9a32
Compare
|
My concern with dropping support for This hypothetical concern may not be realistic. |
I think it's a realistic hypothetical, but I guess that in that case I would advocate for expanding the accepted types to include |
Discussion in dask/dask#9490 and dask/dask#9491 suggests that split_out=None as a default value was never really intended and is likely to be deprecated. Authors: - Lawrence Mitchell (https://github.com/wence-) Approvers: - GALI PREM SAGAR (https://github.com/galipremsagar) - Ashwin Srinath (https://github.com/shwina) - Nghia Truong (https://github.com/ttnghia) URL: #11704
None, which then defaults to 1 in groupby().aggregate()split_out to be None, which then defaults to 1 in groupby().aggregate()
split_out to be None, which then defaults to 1 in groupby().aggregate()split_out to be None, which then defaults to 1 in groupby().aggregate()
split_out=Noneas a default ingroupby.aggregate#9490pre-commit run --all-files