Skip to content

Commit

Permalink
Merge branch 'branch-25.02' into high-lvl-comp-api
Browse files Browse the repository at this point in the history
  • Loading branch information
vuule authored Jan 6, 2025
2 parents 7fa6055 + b81d9e1 commit b2cdcf4
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 10 deletions.
7 changes: 3 additions & 4 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,9 @@ notebooks/ @rapidsai/cudf-python-codeowners
python/dask_cudf/ @rapidsai/cudf-dask-codeowners

#cmake code owners
cpp/CMakeLists.txt @rapidsai/cudf-cmake-codeowners
cpp/libcudf_kafka/CMakeLists.txt @rapidsai/cudf-cmake-codeowners
**/cmake/ @rapidsai/cudf-cmake-codeowners
*.cmake @rapidsai/cudf-cmake-codeowners
CMakeLists.txt @rapidsai/cudf-cmake-codeowners
**/cmake/ @rapidsai/cudf-cmake-codeowners
*.cmake @rapidsai/cudf-cmake-codeowners

#java code owners
java/ @rapidsai/cudf-java-codeowners
Expand Down
14 changes: 13 additions & 1 deletion python/cudf_polars/cudf_polars/dsl/expressions/aggregation.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ def __init__(
op = partial(self._reduce, request=req)
elif name in {"min", "max"}:
op = partial(op, propagate_nans=options)
elif name in {"count", "first", "last"}:
elif name in {"count", "sum", "first", "last"}:
pass
else:
raise NotImplementedError(
Expand Down Expand Up @@ -180,6 +180,18 @@ def _count(self, column: Column) -> Column:
)
)

def _sum(self, column: Column) -> Column:
if column.obj.size() == 0:
return Column(
plc.Column.from_scalar(
plc.interop.from_arrow(
pa.scalar(0, type=plc.interop.to_arrow(self.dtype))
),
1,
)
)
return self._reduce(column, request=plc.aggregation.sum())

def _min(self, column: Column, *, propagate_nans: bool) -> Column:
if propagate_nans and column.nan_count > 0:
return Column(
Expand Down
8 changes: 7 additions & 1 deletion python/cudf_polars/tests/expressions/test_agg.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# SPDX-FileCopyrightText: Copyright (c) 2024 NVIDIA CORPORATION & AFFILIATES.
# SPDX-FileCopyrightText: Copyright (c) 2024-2025, NVIDIA CORPORATION & AFFILIATES.
# SPDX-License-Identifier: Apache-2.0
from __future__ import annotations

Expand Down Expand Up @@ -148,3 +148,9 @@ def test_agg_singleton(op):
q = df.select(op(pl.col("a")))

assert_gpu_result_equal(q)


def test_sum_empty_zero():
df = pl.LazyFrame({"a": pl.Series(values=[], dtype=pl.Int32())})
q = df.select(pl.col("a").sum())
assert_gpu_result_equal(q)
5 changes: 1 addition & 4 deletions python/libcudf/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# =============================================================================
# Copyright (c) 2024, NVIDIA CORPORATION.
# Copyright (c) 2024-2025, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
# in compliance with the License. You may obtain a copy of the License at
Expand Down Expand Up @@ -34,9 +34,6 @@ endif()

unset(cudf_FOUND)

# Find Python early so that later commands can use it
find_package(Python 3.10 REQUIRED COMPONENTS Interpreter)

set(BUILD_TESTS OFF)
set(BUILD_BENCHMARKS OFF)
set(CUDF_BUILD_TESTUTIL OFF)
Expand Down

0 comments on commit b2cdcf4

Please sign in to comment.