/usr/local/lib64/python3.6/site-packages/pyarrow/tests
NameSizeModeActions
data/-0755rm
parquet/-0755rm
__pycache__/-0755rm
arrow_7980.py10940644editdlrm
bound_function_visit_strings.pyx20470644editdlrm
conftest.py79820644editdlrm
deserialize_buffer.py9610644editdlrm
pandas_examples.py51150644editdlrm
pandas_threaded_import.py14290644editdlrm
pyarrow_cython_example.pyx19510644editdlrm
strategies.py125250644editdlrm
test_adhoc_memory_leak.py14100644editdlrm
test_array.py1001570644editdlrm
test_builder.py21840644editdlrm
test_cffi.py130900644editdlrm
test_compute.py835510644editdlrm
test_convert_builtin.py717680644editdlrm
test_csv.py689430644editdlrm
test_cuda.py278630644editdlrm
test_cuda_numba_interop.py87300644editdlrm
test_cython.py59480644editdlrm
test_dataset.py1430230644editdlrm
test_deprecations.py8910644editdlrm
test_extension_type.py244370644editdlrm
test_feather.py232090644editdlrm
test_filesystem.py21060644editdlrm
test_flight.py737150644editdlrm
test_fs.py541330644editdlrm
test_gandiva.py143850644editdlrm
test_hdfs.py134520644editdlrm
test_io.py530660644editdlrm
test_ipc.py312670644editdlrm
test_json.py113250644editdlrm
test_jvm.py154710644editdlrm
test_memory.py49280644editdlrm
test_misc.py49270644editdlrm
test_orc.py92210644editdlrm
test_pandas.py1579090644editdlrm
test_plasma.py440110644editdlrm
test_plasma_tf_op.py35230644editdlrm
test_scalars.py210740644editdlrm
test_schema.py212820644editdlrm
test_serialization.py420260644editdlrm
test_serialization_deprecated.py17750644editdlrm
test_sparse_tensor.py174360644editdlrm
test_strategies.py17390644editdlrm
test_table.py531680644editdlrm
test_tensor.py62700644editdlrm
test_types.py314870644editdlrm
test_util.py17910644editdlrm
util.py90110644editdlrm
__init__.py00644editdlrm
Edit: /usr/local/lib64/python3.6/site-packages/pyarrow/tests/bound_function_visit_strings.pyx (2047B)
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. # distutils: language=c++ # cython: language_level = 3 import pyarrow as pa from pyarrow.lib cimport * from pyarrow.lib import frombytes, tobytes # basic test to roundtrip through a BoundFunction ctypedef CStatus visit_string_cb(const c_string&) cdef extern from * namespace "arrow::py" nogil: """ #include #include #include #include "arrow/status.h" namespace arrow { namespace py { Status VisitStrings(const std::vector& strs, std::function cb) { for (const std::string& str : strs) { RETURN_NOT_OK(cb(str)); } return Status::OK(); } } // namespace py } // namespace arrow """ cdef CStatus CVisitStrings" arrow::py::VisitStrings"( vector[c_string], function[visit_string_cb]) cdef void _visit_strings_impl(py_cb, const c_string& s) except *: py_cb(frombytes(s)) def _visit_strings(strings, cb): cdef: function[visit_string_cb] c_cb vector[c_string] c_strings c_cb = BindFunction[visit_string_cb](&_visit_strings_impl, cb) for s in strings: c_strings.push_back(tobytes(s)) check_status(CVisitStrings(c_strings, c_cb))