Skip to content

Commit

Permalink
Fix dtype usage (#28797)
Browse files Browse the repository at this point in the history
  • Loading branch information
caneff authored Oct 4, 2023
1 parent 0a560fc commit 3cae5ad
Showing 1 changed file with 6 additions and 4 deletions.
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

0 comments on commit 3cae5ad

Please sign in to comment.