Skip to content

Commit

Permalink
Add observed=False to be explicit for Pandas 2.1 (#28823)
Browse files Browse the repository at this point in the history
  • Loading branch information
caneff authored Oct 5, 2023
1 parent 5446776 commit 94a579c
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions sdks/python/apache_beam/dataframe/frames_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -1021,8 +1021,14 @@ def test_categorical_groupby(self):
df = df.set_index('B')
# TODO(BEAM-11190): These aggregations can be done in index partitions, but
# it will require a little more complex logic
self._run_test(lambda df: df.groupby(level=0).sum(), df, nonparallel=True)
self._run_test(lambda df: df.groupby(level=0).mean(), df, nonparallel=True)
self._run_test(
lambda df: df.groupby(level=0, observed=False).sum(),
df,
nonparallel=True)
self._run_test(
lambda df: df.groupby(level=0, observed=False).mean(),
df,
nonparallel=True)

def test_astype_categorical(self):
df = pd.DataFrame({'A': np.arange(6), 'B': list('aabbca')})
Expand Down

0 comments on commit 94a579c

Please sign in to comment.