Skip to content

Commit

Permalink
Merge branch 'branch-24.12' into strings-factory-nvbench
Browse files Browse the repository at this point in the history
  • Loading branch information
davidwendt committed Nov 20, 2024
2 parents 8a7c656 + 05365af commit cd67a30
Show file tree
Hide file tree
Showing 5 changed files with 234 additions and 240 deletions.
10 changes: 2 additions & 8 deletions python/cudf/cudf/_lib/transform.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,10 @@
from numba.np import numpy_support

import cudf
from cudf.core._internals.expressions import parse_expression
from cudf.core.buffer import acquire_spill_lock, as_buffer
from cudf.utils import cudautils

from pylibcudf cimport transform as plc_transform
from pylibcudf.expressions cimport Expression
from pylibcudf.libcudf.types cimport size_type

from cudf._lib.column cimport Column
Expand Down Expand Up @@ -93,7 +91,7 @@ def one_hot_encode(Column input_column, Column categories):


@acquire_spill_lock()
def compute_column(list columns, tuple column_names, expr: str):
def compute_column(list columns, tuple column_names, str expr):
"""Compute a new column by evaluating an expression on a set of columns.
Parameters
Expand All @@ -108,12 +106,8 @@ def compute_column(list columns, tuple column_names, expr: str):
expr : str
The expression to evaluate.
"""
visitor = parse_expression(expr, column_names)

# At the end, all the stack contains is the expression to evaluate.
cdef Expression cudf_expr = visitor.expression
result = plc_transform.compute_column(
plc.Table([col.to_pylibcudf(mode="read") for col in columns]),
cudf_expr,
plc.expressions.to_expression(expr, column_names),
)
return Column.from_pylibcudf(result)
229 changes: 0 additions & 229 deletions python/cudf/cudf/core/_internals/expressions.py

This file was deleted.

11 changes: 8 additions & 3 deletions python/custreamz/custreamz/kafka.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,9 +151,14 @@ def read_gdf(
"parquet": cudf.io.read_parquet,
}

result = cudf_readers[message_format](
kafka_datasource, engine="cudf", lines=True
)
if message_format == "json":
result = cudf_readers[message_format](
kafka_datasource, engine="cudf", lines=True
)
else:
result = cudf_readers[message_format](
kafka_datasource, engine="cudf"
)

# Close up the cudf datasource instance
# TODO: Ideally the C++ destructor should handle the
Expand Down
2 changes: 2 additions & 0 deletions python/pylibcudf/pylibcudf/expressions.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -77,3 +77,5 @@ class Operation(Expression):
left: Expression,
right: Expression | None = None,
): ...

def to_expression(expr: str, column_names: tuple[str, ...]) -> Expression: ...
Loading

0 comments on commit cd67a30

Please sign in to comment.