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 dtype usage #28797

Merged
merged 1 commit into from
Oct 4, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions sdks/python/apache_beam/dataframe/frames.py
Original file line number Diff line number Diff line change
Expand Up @@ -4594,8 +4594,9 @@ def wrapper(self, *args, **kwargs):
return _unliftable_agg(meth)(self, *args, **kwargs)

to_group = self._ungrouped.proxy().index
is_categorical_grouping = any(to_group.get_level_values(i).is_categorical()
for i in self._grouping_indexes)
is_categorical_grouping = any(
isinstance(to_group.get_level_values(i).dtype, pd.CategoricalDtype)
for i in self._grouping_indexes)
groupby_kwargs = self._kwargs
group_keys = self._group_keys

Expand Down Expand Up @@ -4647,8 +4648,9 @@ def wrapper(self, *args, **kwargs):

to_group = self._ungrouped.proxy().index
group_keys = self._group_keys
is_categorical_grouping = any(to_group.get_level_values(i).is_categorical()
for i in self._grouping_indexes)
is_categorical_grouping = any(
isinstance(to_group.get_level_values(i).dtype, pd.CategoricalDtype)
for i in self._grouping_indexes)

groupby_kwargs = self._kwargs
project = _maybe_project_func(self._projection)
Expand Down
Loading