Skip to content

Commit 40b0711

Browse files
committed
apply review comment
1 parent 6043fd0 commit 40b0711

File tree

2 files changed

+4
-11
lines changed

2 files changed

+4
-11
lines changed

python/pyarrow/includes/libarrow.pxd

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3010,11 +3010,5 @@ cdef extern from "arrow/python/udf.h" namespace "arrow::py" nogil:
30103010
CResult[shared_ptr[CRecordBatchReader]] CallTabularFunction(
30113011
const c_string& func_name, const vector[CDatum]& args, CFunctionRegistry* registry)
30123012

3013-
cdef extern from "arrow/type.h" namespace "arrow":
3014-
cdef cppclass CTypeHolder" arrow::TypeHolder":
3015-
CTypeHolder()
3016-
CTypeHolder(const shared_ptr[CDataType]& type)
3017-
30183013
cdef extern from "arrow/compute/cast.h" namespace "arrow::compute":
3019-
CResult[CDatum] Cast(const CDatum& value, const CTypeHolder& to_type, const CCastOptions& options,
3020-
CExecContext * ctx)
3014+
CResult[CDatum] Cast(const CDatum& value, const CCastOptions& options)

python/pyarrow/tests/pyarrow_cython_example.pyx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,7 @@ def cast_scalar(scalar, to_type):
4343
shared_ptr[CScalar] c_scalar
4444
shared_ptr[CDataType] c_type
4545
CCastOptions cast_options
46-
CExecContext * ctx = NULL
4746
CDatum c_datum
48-
CTypeHolder c_type_holder
4947
CResult[CDatum] c_cast_result
5048

5149
c_scalar = pyarrow_unwrap_scalar(scalar)
@@ -56,7 +54,8 @@ def cast_scalar(scalar, to_type):
5654
raise TypeError("not a type")
5755

5856
c_datum = CDatum(c_scalar)
59-
c_type_holder = CTypeHolder(c_type)
60-
c_cast_result = Cast(c_datum, c_type_holder, cast_options, ctx)
57+
cast_options = CCastOptions()
58+
cast_options.to_type = c_type
59+
c_cast_result = Cast(c_datum, cast_options)
6160
c_datum = GetResultValue(c_cast_result)
6261
return pyarrow_wrap_scalar(c_datum.scalar())

0 commit comments

Comments
 (0)