From 987845a4be114e6f7e9ffdc966e6c7fb8fba7907 Mon Sep 17 00:00:00 2001 From: Jeremy Aguilon Date: Mon, 13 Nov 2023 23:33:43 -0500 Subject: [PATCH] Clean up a little --- python/CMakeLists.txt | 4 ---- python/pyarrow/_dataset.pyx | 6 ++++-- python/pyarrow/_dataset_parquet.pyx | 1 + python/pyarrow/lib.pxd | 7 +------ 4 files changed, 6 insertions(+), 12 deletions(-) diff --git a/python/CMakeLists.txt b/python/CMakeLists.txt index b9fa91e97b639..c79c556449dfd 100644 --- a/python/CMakeLists.txt +++ b/python/CMakeLists.txt @@ -385,15 +385,11 @@ configure_file( "${PROJECT_SOURCE_DIR}/${PYARROW_CPP_SOURCE_DIR}/pyarrow_config.h" ESCAPE_QUOTES ) -# install(FILES "${ARROW_BINARY_DIR}/src/arrow/util/config.h" -# DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/arrow/util") message(" Source dir ${PYARROW_CPP_SOURCE_DIR}") message(" Include dir ${CMAKE_INSTALL_INCLUDEDIR}") install(FILES "${PYARROW_CPP_SOURCE_DIR}/pyarrow_config.h" DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/arrow/python") -# message(FATAL_ERROR "DONE") - add_library(arrow_python SHARED ${PYARROW_CPP_SRCS}) message("PYARROW CPP SOURCE DIR ${PYARROW_CPP_SOURCE_DIR}") message("PYARROW CPP SOURCES ${PYARROW_CPP_SRCS}") diff --git a/python/pyarrow/_dataset.pyx b/python/pyarrow/_dataset.pyx index 6650a49005fa5..48ee676915311 100644 --- a/python/pyarrow/_dataset.pyx +++ b/python/pyarrow/_dataset.pyx @@ -27,10 +27,11 @@ from libcpp cimport bool import pyarrow as pa from pyarrow.lib cimport * -from pyarrow.lib import ArrowTypeError, frombytes, tobytes, _pac, _forbid_instantiation +from pyarrow.lib import ArrowTypeError, frombytes, tobytes, _pac from pyarrow.includes.libarrow_dataset cimport * -from pyarrow._compute cimport Expression, _bind from pyarrow._acero cimport ExecNodeOptions +from pyarrow._compute cimport Expression, _bind +from pyarrow._compute import _forbid_instantiation from pyarrow._fs cimport FileSystem, FileSelector from pyarrow._csv cimport ( ConvertOptions, ParseOptions, ReadOptions, WriteOptions) @@ -146,6 +147,7 @@ cdef str _wrap_segment_encoding(CSegmentEncoding segment_encoding): cdef Expression _true = Expression._scalar(True) + cdef class Dataset(_Weakrefable): """ Collection of data fragments and potentially child datasets. diff --git a/python/pyarrow/_dataset_parquet.pyx b/python/pyarrow/_dataset_parquet.pyx index 051f51ceaf9d2..31aa058706a87 100644 --- a/python/pyarrow/_dataset_parquet.pyx +++ b/python/pyarrow/_dataset_parquet.pyx @@ -52,6 +52,7 @@ from pyarrow._parquet cimport ( FileMetaData, ) + try: from pyarrow._dataset_parquet_encryption import ( set_encryption_config, set_decryption_config diff --git a/python/pyarrow/lib.pxd b/python/pyarrow/lib.pxd index 0c0d6f5740dda..63ebe6aea8233 100644 --- a/python/pyarrow/lib.pxd +++ b/python/pyarrow/lib.pxd @@ -21,12 +21,10 @@ from cpython cimport PyObject from libcpp cimport nullptr, bool as c_bool from libcpp.cast cimport dynamic_cast from libcpp.memory cimport dynamic_pointer_cast -from pyarrow.lib cimport * from pyarrow.includes.common cimport * from pyarrow.includes.libarrow cimport * from pyarrow.includes.libarrow_python cimport * - # Will be available in Cython 3, not backported # ref: https://github.com/cython/cython/issues/3293#issuecomment-1223058101 cdef extern from "" namespace "std" nogil: @@ -640,9 +638,6 @@ cdef public object pyarrow_wrap_tensor(const shared_ptr[CTensor]& sp_tensor) cdef public object pyarrow_wrap_batch(const shared_ptr[CRecordBatch]& cbatch) cdef public object pyarrow_wrap_table(const shared_ptr[CTable]& ctable) -# TODO: extract -# cdef public object pyarrow_wrap_expression(const CExpression& expr) - # Unwrapping Python -> C++ cdef public shared_ptr[CBuffer] pyarrow_unwrap_buffer(object buffer) @@ -666,6 +661,6 @@ cdef public shared_ptr[CSparseCSFTensor] pyarrow_unwrap_sparse_csf_tensor( cdef public shared_ptr[CSparseCSRMatrix] pyarrow_unwrap_sparse_csr_matrix( object sparse_tensor) cdef public shared_ptr[CTensor] pyarrow_unwrap_tensor(object tensor) -cdef public shared_ptr[CRecordBatch] pyarrow_unwrap_batch(object batch) +cdef public shared_ptr[CRecordBatch] pyarrow_unwrap_batch(object batch) cdef public shared_ptr[CTable] pyarrow_unwrap_table(object table)