Skip to content
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

Fix an error with groupby value_counts for pandas 2.0 compatibility #9928

Merged
merged 5 commits into from Feb 13, 2023

Conversation

j-bennet
Copy link
Contributor

@j-bennet j-bennet commented Feb 7, 2023

Fix an upstream error with Pandas 2.0:

dask/dataframe/tests/test_groupby.py::test_groupby_value_counts[disk-foo]: KeyError: 'Column not found: count'

Related to the following change in pandas:

https://pandas.pydata.org/docs/dev/whatsnew/v2.0.0.html#value-counts-sets-the-resulting-name-to-count

  • Passes pre-commit run --all-files

@j-bennet
Copy link
Contributor Author

j-bennet commented Feb 7, 2023

Test failure is unrelated:

FAILED dask/tests/test_distributed.py::test_blockwise_dataframe_io[True-None-hdf] - AssertionError: DataFrame are different

@j-bennet j-bennet changed the title Fix an error with groupby value_counts for pandas 2.0 compatibility Fix an error with groupby value_counts for pandas 2.0 compatibility Feb 8, 2023
Copy link
Member

@jrbourbeau jrbourbeau left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @j-bennet!

dask/dataframe/groupby.py Outdated Show resolved Hide resolved
@jrbourbeau
Copy link
Member

It looks like there's a merge conflict, but otherwise this looks good to me

@j-bennet j-bennet force-pushed the j-bennet/9736-groupby-value-counts branch from e2a5f5f to 78768cd Compare February 10, 2023 23:28
@j-bennet j-bennet force-pushed the j-bennet/9736-groupby-value-counts branch from 78768cd to 9834276 Compare February 10, 2023 23:39
@j-bennet
Copy link
Contributor Author

It looks like there's a merge conflict, but otherwise this looks good to me.

I rebased on main, waiting for CI.

@j-bennet j-bennet force-pushed the j-bennet/9736-groupby-value-counts branch from 4a701f5 to a2bea28 Compare February 11, 2023 04:08
Copy link
Member

@jrbourbeau jrbourbeau left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @j-bennet -- this is in

@jrbourbeau jrbourbeau merged commit fe52c0d into dask:main Feb 13, 2023
@j-bennet j-bennet deleted the j-bennet/9736-groupby-value-counts branch February 13, 2023 21:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants