Skip to content

Commit

Permalink
Address reviews
Browse files Browse the repository at this point in the history
  • Loading branch information
mroeschke committed Dec 19, 2024
1 parent 4019ba2 commit bdcd0bd
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions python/cudf/cudf/core/_internals/aggregation.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@

class Aggregation:
def __init__(self, agg: plc.aggregation.Aggregation) -> None:
self.c_obj = agg
self.plc_obj = agg

@property
def kind(self) -> str:
name = self.c_obj.kind().name
name = self.plc_obj.kind().name
return _agg_name_map.get(name, name)

@classmethod
Expand Down
4 changes: 2 additions & 2 deletions python/cudf/cudf/core/column/column.py
Original file line number Diff line number Diff line change
Expand Up @@ -1605,7 +1605,7 @@ def scan(self, scan_op: str, inclusive: bool, **kwargs) -> Self:
return type(self).from_pylibcudf( # type: ignore[return-value]
plc.reduce.scan(
self.to_pylibcudf(mode="read"),
aggregation.make_aggregation(scan_op, kwargs).c_obj,
aggregation.make_aggregation(scan_op, kwargs).plc_obj,
plc.reduce.ScanType.INCLUSIVE
if inclusive
else plc.reduce.ScanType.EXCLUSIVE,
Expand Down Expand Up @@ -1637,7 +1637,7 @@ def reduce(self, reduction_op: str, dtype=None, **kwargs) -> ScalarLike:
with acquire_spill_lock():
plc_scalar = plc.reduce.reduce(
self.to_pylibcudf(mode="read"),
aggregation.make_aggregation(reduction_op, kwargs).c_obj,
aggregation.make_aggregation(reduction_op, kwargs).plc_obj,
dtype_to_pylibcudf_type(col_dtype),
)
result_col = type(self).from_pylibcudf(
Expand Down
4 changes: 2 additions & 2 deletions python/cudf/cudf/core/groupby/groupby.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ def _(dtype: CategoricalDtype, str_agg: str) -> bool:

def _is_all_scan_aggregate(all_aggs: list[list[str]]) -> bool:
"""
Returns true if all are scan aggregations.
Returns True if all are scan aggregations.
Raises
------
Expand Down Expand Up @@ -809,7 +809,7 @@ def _aggregate(
or agg_obj.kind in valid_aggregations
):
included_aggregations_i.append((agg, agg_obj.kind))
col_aggregations.append(agg_obj.c_obj)
col_aggregations.append(agg_obj.plc_obj)
included_aggregations.append(included_aggregations_i)
result_columns.append([])
if col_aggregations:
Expand Down
2 changes: 1 addition & 1 deletion python/cudf/cudf/core/window/rolling.py
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ def _apply_agg_column(self, source_column, agg_name):
{"dtype": source_column.dtype}
if callable(agg_name)
else self.agg_params,
).c_obj,
).plc_obj,
)
)

Expand Down

0 comments on commit bdcd0bd

Please sign in to comment.