Skip to content

Commit 73bc203

Browse files
committed
use strings instead of bytes for function names
1 parent f589de3 commit 73bc203

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

python/pyarrow/gandiva.pyx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ cdef class TreeExprBuilder:
145145
for child in children:
146146
c_children.push_back(child.node)
147147
cdef shared_ptr[CNode] r = TreeExprBuilder_MakeFunction(
148-
name, c_children, return_type.sp_type)
148+
name.encode(), c_children, return_type.sp_type)
149149
return make_node(r)
150150

151151
def make_field(self, Field field):

python/pyarrow/tests/test_gandiva.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ def test_tree_exp_builder():
3737
node_a = builder.make_field(field_a)
3838
node_b = builder.make_field(field_b)
3939

40-
condition = builder.make_function(b"greater_than", [node_a, node_b],
40+
condition = builder.make_function("greater_than", [node_a, node_b],
4141
pa.bool_())
4242
if_node = builder.make_if(condition, node_a, node_b, pa.int32())
4343

@@ -66,7 +66,7 @@ def test_table():
6666
node_a = builder.make_field(table.schema.field_by_name("a"))
6767
node_b = builder.make_field(table.schema.field_by_name("b"))
6868

69-
sum = builder.make_function(b"add", [node_a, node_b], pa.float64())
69+
sum = builder.make_function("add", [node_a, node_b], pa.float64())
7070

7171
field_result = pa.field("c", pa.float64())
7272
expr = builder.make_expression(sum, field_result)
@@ -92,7 +92,7 @@ def test_filter():
9292
builder = gandiva.TreeExprBuilder()
9393
node_a = builder.make_field(table.schema.field_by_name("a"))
9494
thousand = builder.make_literal(1000.0)
95-
cond = builder.make_function(b"less_than", [node_a, thousand], pa.bool_())
95+
cond = builder.make_function("less_than", [node_a, thousand], pa.bool_())
9696
condition = builder.make_condition(cond)
9797

9898
filter = gandiva.make_filter(table.schema, condition)

0 commit comments

Comments
 (0)