Fixes related to group_keys default change in pandas 2.0#9855
Fixes related to group_keys default change in pandas 2.0#9855jrbourbeau merged 4 commits intodask:mainfrom
group_keys default change in pandas 2.0#9855Conversation
group_keys default change in pandas 2.0
jrbourbeau
left a comment
There was a problem hiding this comment.
Thanks @j-bennet! Overall this looks good to me. Just one small suggestion.
Also, I see this is marked as a draft PR. Are there other things you'd still like to include here?
| no_default = "__no_default__" | ||
|
|
||
| GROUP_KEYS_DEFAULT = None if PANDAS_GT_150 else True | ||
| GROUP_KEYS_DEFAULT = None |
There was a problem hiding this comment.
It looks like this line may not be needed
| GROUP_KEYS_DEFAULT = None |
There was a problem hiding this comment.
Initially this is how I had it, but I get a complaint from mypy:
mypy.....................................................................Failed
- hook id: mypy
- exit code: 1
dask/dataframe/core.py:104: error: Incompatible types in assignment (expression has type "None", variable has type "bool") [assignment]
There was a problem hiding this comment.
Ah, I see. Thanks for clarifying. I went ahead and pushed a tiny commit (53b2d77) that removes the unused assignment, but still makes mypy happy (hope you don't mind). That should, hopefully, make this easier for future readers to reason about.
There was a problem hiding this comment.
I like your version, it's shorter too. I don't see type hints used much in our codebase, but since we support Python 3.8+, we could be using them more, right? What's the general agreement on using them? More is good, less is good?
No, not a draft anymore. |
Related: #9736.
In pandas 2.0,
groupbyadds group keys to index.pre-commit run --all-files