Skip to content

Conversation

@jrycw
Copy link
Collaborator

@jrycw jrycw commented Feb 14, 2024

There's a future warning displayed in the stub:

FutureWarning: DataFrameGroupBy.grouper is deprecated and will be removed in a future version of pandas.

More details related to this warning can be found in the Pandas v2.2.0 release notes and issue GH 56521.

Instead of using g_df.grouper.indices, it might be better to directly use g_df.indices. By using g_df.indices, we shouldn't encounter any backward compatibility issues IMO.

BTW, if we don't really need the values as a list type, directly returning data.groupby(group_key).indices might be another option.

@rich-iannone rich-iannone requested a review from machow February 14, 2024 04:36
Copy link
Collaborator

@machow machow left a comment

Choose a reason for hiding this comment

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

Nice catch, thanks! It looks like this indices method has been around for a while, so should be okay to use!

@machow machow merged commit 8c70a6d into posit-dev:main Feb 14, 2024
@jrycw jrycw deleted the fix-stub branch February 14, 2024 15:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants