Skip to content

Commit 3cae5ad

Browse files
authored
Fix dtype usage (#28797)
1 parent 0a560fc commit 3cae5ad

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

sdks/python/apache_beam/dataframe/frames.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4594,8 +4594,9 @@ def wrapper(self, *args, **kwargs):
45944594
return _unliftable_agg(meth)(self, *args, **kwargs)
45954595

45964596
to_group = self._ungrouped.proxy().index
4597-
is_categorical_grouping = any(to_group.get_level_values(i).is_categorical()
4598-
for i in self._grouping_indexes)
4597+
is_categorical_grouping = any(
4598+
isinstance(to_group.get_level_values(i).dtype, pd.CategoricalDtype)
4599+
for i in self._grouping_indexes)
45994600
groupby_kwargs = self._kwargs
46004601
group_keys = self._group_keys
46014602

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

46484649
to_group = self._ungrouped.proxy().index
46494650
group_keys = self._group_keys
4650-
is_categorical_grouping = any(to_group.get_level_values(i).is_categorical()
4651-
for i in self._grouping_indexes)
4651+
is_categorical_grouping = any(
4652+
isinstance(to_group.get_level_values(i).dtype, pd.CategoricalDtype)
4653+
for i in self._grouping_indexes)
46524654

46534655
groupby_kwargs = self._kwargs
46544656
project = _maybe_project_func(self._projection)

0 commit comments

Comments
 (0)