Skip to content

Commit

Permalink
Avoid warning from cudf regardning an upcoming change of behavior whe…
Browse files Browse the repository at this point in the history
…n applying a groupby to a list with only a single element refer: https://github.com/rapidsai/cudf/blob/branch-24.02/python/cudf/cudf/core/groupby/groupby.py#L281
  • Loading branch information
dagardner-nv committed Jan 6, 2024
1 parent 42614ec commit 074081e
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion morpheus/modules/payload_batcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,12 @@ def _batch_dataframe_by_group(df: cudf.DataFrame) -> typing.List[cudf.DataFrame]
# Period object conversion is not supported in cudf
df[period_column] = df[period_column].to_pandas().dt.to_period(period).astype('str')

groups = df.groupby(group_by_columns)
if len(group_by_columns) == 1:
group_by_columns_ = group_by_columns[0]
else:
group_by_columns_ = group_by_columns

groups = df.groupby(group_by_columns_)

dfs = []
for _, group in groups:
Expand Down

0 comments on commit 074081e

Please sign in to comment.