diff --git a/python/pyarrow/src/CMakeLists.txt b/python/pyarrow/src/CMakeLists.txt index f60b3e67ece3..7841743c128f 100644 --- a/python/pyarrow/src/CMakeLists.txt +++ b/python/pyarrow/src/CMakeLists.txt @@ -73,31 +73,31 @@ set(Python3_FIND_REGISTRY "LAST") set(Python3_FIND_FRAMEWORK "LAST") find_package(Python3Alt 3.7 REQUIRED) -include_directories(SYSTEM ${NUMPY_INCLUDE_DIRS} ${PYTHON_INCLUDE_DIRS} ${ARROW_INCLUDE_DIR} src) +include_directories(SYSTEM ${NUMPY_INCLUDE_DIRS} ${PYTHON_INCLUDE_DIRS} ${ARROW_INCLUDE_DIR} ${CMAKE_SOURCE_DIR} src) add_custom_target(arrow_python) set(ARROW_PYTHON_SRCS - arrow_to_pandas.cc - benchmark.cc - common.cc - datetime.cc - decimal.cc - deserialize.cc - extension_type.cc - gdb.cc - helpers.cc - inference.cc - init.cc - io.cc - ipc.cc - numpy_convert.cc - numpy_to_arrow.cc - python_test.cc - python_to_arrow.cc - pyarrow.cc - serialize.cc - udf.cc) + arrow/python/arrow_to_pandas.cc + arrow/python/benchmark.cc + arrow/python/common.cc + arrow/python/datetime.cc + arrow/python/decimal.cc + arrow/python/deserialize.cc + arrow/python/extension_type.cc + arrow/python/gdb.cc + arrow/python/helpers.cc + arrow/python/inference.cc + arrow/python/init.cc + arrow/python/io.cc + arrow/python/ipc.cc + arrow/python/numpy_convert.cc + arrow/python/numpy_to_arrow.cc + arrow/python/python_test.cc + arrow/python/python_to_arrow.cc + arrow/python/pyarrow.cc + arrow/python/serialize.cc + arrow/python/udf.cc) set_source_files_properties(init.cc PROPERTIES SKIP_PRECOMPILE_HEADERS ON SKIP_UNITY_BUILD_INCLUSION ON) @@ -127,7 +127,7 @@ endif() if(PYARROW_WITH_PARQUET_ENCRYPTION) if(PARQUET_REQUIRE_ENCRYPTION) - list(APPEND ARROW_PYTHON_SRCS parquet_encryption.cc) + list(APPEND ARROW_PYTHON_SRCS arrow/python/parquet_encryption.cc) find_package(Parquet REQUIRED) list(APPEND ARROW_PYTHON_SHARED_LINK_LIBS Parquet::parquet_shared) list(APPEND ARROW_PYTHON_SHARED_INSTALL_INTERFACE_LIBS Parquet::parquet_shared) @@ -146,11 +146,11 @@ endif() # Check for only Arrow C++ options if(ARROW_CSV) - list(APPEND ARROW_PYTHON_SRCS csv.cc) + list(APPEND ARROW_PYTHON_SRCS arrow/python/csv.cc) endif() if(ARROW_FILESYSTEM) - list(APPEND ARROW_PYTHON_SRCS filesystem.cc) + list(APPEND ARROW_PYTHON_SRCS arrow/python/filesystem.cc) endif() if(CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang" OR CMAKE_CXX_COMPILER_ID STREQUAL "Clang") @@ -225,7 +225,7 @@ add_arrow_lib(arrow_python SOURCES ${ARROW_PYTHON_SRCS} PRECOMPILED_HEADERS - "$<$:pch.h>" + "$<$:arrow/python/pch.h>" OUTPUTS ARROW_PYTHON_LIBRARIES SHARED_LINK_FLAGS @@ -269,7 +269,7 @@ if(ARROW_FLIGHT AND ARROW_BUILD_SHARED) PKG_CONFIG_NAME arrow-python-flight SOURCES - flight.cc + arrow/python/flight.cc OUTPUTS ARROW_PYFLIGHT_LIBRARIES SHARED_LINK_FLAGS @@ -309,4 +309,4 @@ if(CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang" OR CMAKE_CXX_COMPILER_ID STREQUAL PROPERTY COMPILE_FLAGS -Wno-parentheses-equality) endif() -arrow_install_all_headers("arrow/python") +add_subdirectory(arrow/python) diff --git a/python/pyarrow/src/arrow/python/CMakeLists.txt b/python/pyarrow/src/arrow/python/CMakeLists.txt new file mode 100644 index 000000000000..ff355e46a4bd --- /dev/null +++ b/python/pyarrow/src/arrow/python/CMakeLists.txt @@ -0,0 +1,18 @@ +# 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. + +arrow_install_all_headers("arrow/python") diff --git a/python/pyarrow/src/api.h b/python/pyarrow/src/arrow/python/api.h similarity index 66% rename from python/pyarrow/src/api.h rename to python/pyarrow/src/arrow/python/api.h index 28c46c95e947..a0b13d6d1301 100644 --- a/python/pyarrow/src/api.h +++ b/python/pyarrow/src/arrow/python/api.h @@ -17,14 +17,14 @@ #pragma once -#include "arrow_to_pandas.h" -#include "common.h" -#include "datetime.h" -#include "deserialize.h" -#include "helpers.h" -#include "inference.h" -#include "io.h" -#include "numpy_convert.h" -#include "numpy_to_arrow.h" -#include "python_to_arrow.h" -#include "serialize.h" +#include "arrow/python/arrow_to_pandas.h" +#include "arrow/python/common.h" +#include "arrow/python/datetime.h" +#include "arrow/python/deserialize.h" +#include "arrow/python/helpers.h" +#include "arrow/python/inference.h" +#include "arrow/python/io.h" +#include "arrow/python/numpy_convert.h" +#include "arrow/python/numpy_to_arrow.h" +#include "arrow/python/python_to_arrow.h" +#include "arrow/python/serialize.h" diff --git a/python/pyarrow/src/arrow_to_pandas.cc b/python/pyarrow/src/arrow/python/arrow_to_pandas.cc similarity index 99% rename from python/pyarrow/src/arrow_to_pandas.cc rename to python/pyarrow/src/arrow/python/arrow_to_pandas.cc index ba67eb10553a..af778f5a8fab 100644 --- a/python/pyarrow/src/arrow_to_pandas.cc +++ b/python/pyarrow/src/arrow/python/arrow_to_pandas.cc @@ -17,8 +17,8 @@ // Functions for pandas conversion via NumPy -#include "arrow_to_pandas.h" -#include "numpy_interop.h" // IWYU pragma: expand +#include "arrow/python/arrow_to_pandas.h" +#include "arrow/python/numpy_interop.h" // IWYU pragma: expand #include #include @@ -48,16 +48,16 @@ #include "arrow/compute/api.h" -#include "arrow_to_python_internal.h" -#include "common.h" -#include "datetime.h" -#include "decimal.h" -#include "helpers.h" -#include "numpy_convert.h" -#include "numpy_internal.h" -#include "pyarrow.h" -#include "python_to_arrow.h" -#include "type_traits.h" +#include "arrow/python/arrow_to_python_internal.h" +#include "arrow/python/common.h" +#include "arrow/python/datetime.h" +#include "arrow/python/decimal.h" +#include "arrow/python/helpers.h" +#include "arrow/python/numpy_convert.h" +#include "arrow/python/numpy_internal.h" +#include "arrow/python/pyarrow.h" +#include "arrow/python/python_to_arrow.h" +#include "arrow/python/type_traits.h" namespace arrow { diff --git a/python/pyarrow/src/arrow_to_pandas.h b/python/pyarrow/src/arrow/python/arrow_to_pandas.h similarity index 98% rename from python/pyarrow/src/arrow_to_pandas.h rename to python/pyarrow/src/arrow/python/arrow_to_pandas.h index 33c08b6fe812..6570364b8d2a 100644 --- a/python/pyarrow/src/arrow_to_pandas.h +++ b/python/pyarrow/src/arrow/python/arrow_to_pandas.h @@ -20,14 +20,14 @@ #pragma once -#include "platform.h" +#include "arrow/python/platform.h" #include #include #include #include "arrow/memory_pool.h" -#include "visibility.h" +#include "arrow/python/visibility.h" namespace arrow { diff --git a/python/pyarrow/src/arrow_to_python_internal.h b/python/pyarrow/src/arrow/python/arrow_to_python_internal.h similarity index 97% rename from python/pyarrow/src/arrow_to_python_internal.h rename to python/pyarrow/src/arrow/python/arrow_to_python_internal.h index 251c2a38ca0c..514cda320012 100644 --- a/python/pyarrow/src/arrow_to_python_internal.h +++ b/python/pyarrow/src/arrow/python/arrow_to_python_internal.h @@ -18,7 +18,7 @@ #pragma once #include "arrow/array.h" -#include "platform.h" +#include "arrow/python/platform.h" namespace arrow { namespace py { diff --git a/python/pyarrow/src/benchmark.cc b/python/pyarrow/src/arrow/python/benchmark.cc similarity index 94% rename from python/pyarrow/src/benchmark.cc rename to python/pyarrow/src/arrow/python/benchmark.cc index 1e56552ed80b..6dcc959ed221 100644 --- a/python/pyarrow/src/benchmark.cc +++ b/python/pyarrow/src/arrow/python/benchmark.cc @@ -15,8 +15,8 @@ // specific language governing permissions and limitations // under the License. -#include "benchmark.h" -#include "helpers.h" +#include "arrow/python/benchmark.h" +#include "arrow/python/helpers.h" namespace arrow { namespace py { diff --git a/python/pyarrow/src/benchmark.h b/python/pyarrow/src/arrow/python/benchmark.h similarity index 93% rename from python/pyarrow/src/benchmark.h rename to python/pyarrow/src/arrow/python/benchmark.h index 883f02fecebb..8060dd33722a 100644 --- a/python/pyarrow/src/benchmark.h +++ b/python/pyarrow/src/arrow/python/benchmark.h @@ -17,9 +17,9 @@ #pragma once -#include "platform.h" +#include "arrow/python/platform.h" -#include "visibility.h" +#include "arrow/python/visibility.h" namespace arrow { namespace py { diff --git a/python/pyarrow/src/common.cc b/python/pyarrow/src/arrow/python/common.cc similarity index 98% rename from python/pyarrow/src/common.cc rename to python/pyarrow/src/arrow/python/common.cc index 09dde3e44898..6fe2ed4dae32 100644 --- a/python/pyarrow/src/common.cc +++ b/python/pyarrow/src/arrow/python/common.cc @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. -#include "common.h" +#include "arrow/python/common.h" #include #include @@ -26,7 +26,7 @@ #include "arrow/util/checked_cast.h" #include "arrow/util/logging.h" -#include "helpers.h" +#include "arrow/python/helpers.h" namespace arrow { diff --git a/python/pyarrow/src/common.h b/python/pyarrow/src/arrow/python/common.h similarity index 99% rename from python/pyarrow/src/common.h rename to python/pyarrow/src/arrow/python/common.h index 59f15c8a135f..8c70e19e3160 100644 --- a/python/pyarrow/src/common.h +++ b/python/pyarrow/src/arrow/python/common.h @@ -24,8 +24,8 @@ #include "arrow/buffer.h" #include "arrow/result.h" #include "arrow/util/macros.h" -#include "pyarrow.h" -#include "visibility.h" +#include "arrow/python/pyarrow.h" +#include "arrow/python/visibility.h" namespace arrow { diff --git a/python/pyarrow/src/csv.cc b/python/pyarrow/src/arrow/python/csv.cc similarity index 98% rename from python/pyarrow/src/csv.cc rename to python/pyarrow/src/arrow/python/csv.cc index 61ff23a22ed8..1df3a94cef22 100644 --- a/python/pyarrow/src/csv.cc +++ b/python/pyarrow/src/arrow/python/csv.cc @@ -19,7 +19,7 @@ #include -#include "common.h" +#include "arrow/python/common.h" namespace arrow { diff --git a/python/pyarrow/src/csv.h b/python/pyarrow/src/arrow/python/csv.h similarity index 97% rename from python/pyarrow/src/csv.h rename to python/pyarrow/src/arrow/python/csv.h index e6e53af0f858..2295c49461ba 100644 --- a/python/pyarrow/src/csv.h +++ b/python/pyarrow/src/arrow/python/csv.h @@ -24,7 +24,7 @@ #include "arrow/csv/options.h" #include "arrow/util/macros.h" -#include "common.h" +#include "arrow/python/common.h" namespace arrow { namespace py { diff --git a/python/pyarrow/src/datetime.cc b/python/pyarrow/src/arrow/python/datetime.cc similarity index 99% rename from python/pyarrow/src/datetime.cc rename to python/pyarrow/src/arrow/python/datetime.cc index c4591ab50e00..576d0d8a9302 100644 --- a/python/pyarrow/src/datetime.cc +++ b/python/pyarrow/src/arrow/python/datetime.cc @@ -27,10 +27,10 @@ #include "arrow/type.h" #include "arrow/util/logging.h" #include "arrow/util/value_parsing.h" -#include "arrow_to_python_internal.h" -#include "common.h" -#include "helpers.h" -#include "platform.h" +#include "arrow/python/arrow_to_python_internal.h" +#include "arrow/python/common.h" +#include "arrow/python/helpers.h" +#include "arrow/python/platform.h" namespace arrow { namespace py { diff --git a/python/pyarrow/src/datetime.h b/python/pyarrow/src/arrow/python/datetime.h similarity index 99% rename from python/pyarrow/src/datetime.h rename to python/pyarrow/src/arrow/python/datetime.h index 6f9bfbe2dbfd..ed3c4f68289d 100644 --- a/python/pyarrow/src/datetime.h +++ b/python/pyarrow/src/arrow/python/datetime.h @@ -20,12 +20,12 @@ #include #include -#include "platform.h" -#include "visibility.h" #include "arrow/status.h" #include "arrow/type.h" #include "arrow/type_fwd.h" #include "arrow/util/logging.h" +#include "arrow/python/platform.h" +#include "arrow/python/visibility.h" // By default, PyDateTimeAPI is a *static* variable. This forces // PyDateTime_IMPORT to be called in every C/C++ module using the diff --git a/python/pyarrow/src/decimal.cc b/python/pyarrow/src/arrow/python/decimal.cc similarity index 98% rename from python/pyarrow/src/decimal.cc rename to python/pyarrow/src/arrow/python/decimal.cc index a7244f9dcc11..46ad9bc70c51 100644 --- a/python/pyarrow/src/decimal.cc +++ b/python/pyarrow/src/arrow/python/decimal.cc @@ -18,12 +18,12 @@ #include #include -#include "common.h" -#include "decimal.h" -#include "helpers.h" #include "arrow/type_fwd.h" #include "arrow/util/decimal.h" #include "arrow/util/logging.h" +#include "arrow/python/common.h" +#include "arrow/python/decimal.h" +#include "arrow/python/helpers.h" namespace arrow { namespace py { diff --git a/python/pyarrow/src/decimal.h b/python/pyarrow/src/arrow/python/decimal.h similarity index 99% rename from python/pyarrow/src/decimal.h rename to python/pyarrow/src/arrow/python/decimal.h index 5c4a17dcd480..1187037aed29 100644 --- a/python/pyarrow/src/decimal.h +++ b/python/pyarrow/src/arrow/python/decimal.h @@ -19,7 +19,7 @@ #include -#include "visibility.h" +#include "arrow/python/visibility.h" #include "arrow/type.h" namespace arrow { diff --git a/python/pyarrow/src/deserialize.cc b/python/pyarrow/src/arrow/python/deserialize.cc similarity index 98% rename from python/pyarrow/src/deserialize.cc rename to python/pyarrow/src/arrow/python/deserialize.cc index ad28874460a4..961a1686e0a8 100644 --- a/python/pyarrow/src/deserialize.cc +++ b/python/pyarrow/src/arrow/python/deserialize.cc @@ -15,9 +15,9 @@ // specific language governing permissions and limitations // under the License. -#include "deserialize.h" +#include "arrow/python/deserialize.h" -#include "numpy_interop.h" +#include "arrow/python/numpy_interop.h" #include #include @@ -40,12 +40,12 @@ #include "arrow/util/logging.h" #include "arrow/util/value_parsing.h" -#include "common.h" -#include "datetime.h" -#include "helpers.h" -#include "numpy_convert.h" -#include "pyarrow.h" -#include "serialize.h" +#include "arrow/python/common.h" +#include "arrow/python/datetime.h" +#include "arrow/python/helpers.h" +#include "arrow/python/numpy_convert.h" +#include "arrow/python/pyarrow.h" +#include "arrow/python/serialize.h" namespace arrow { diff --git a/python/pyarrow/src/deserialize.h b/python/pyarrow/src/arrow/python/deserialize.h similarity index 98% rename from python/pyarrow/src/deserialize.h rename to python/pyarrow/src/arrow/python/deserialize.h index 08d0972048d1..ed8294231eea 100644 --- a/python/pyarrow/src/deserialize.h +++ b/python/pyarrow/src/arrow/python/deserialize.h @@ -21,9 +21,9 @@ #include #include -#include "serialize.h" -#include "visibility.h" #include "arrow/status.h" +#include "arrow/python/serialize.h" +#include "arrow/python/visibility.h" namespace arrow { diff --git a/python/pyarrow/src/extension_type.cc b/python/pyarrow/src/arrow/python/extension_type.cc similarity index 98% rename from python/pyarrow/src/extension_type.cc rename to python/pyarrow/src/arrow/python/extension_type.cc index 9fd2f2e1466d..6b3cb29ac252 100644 --- a/python/pyarrow/src/extension_type.cc +++ b/python/pyarrow/src/arrow/python/extension_type.cc @@ -19,11 +19,11 @@ #include #include -#include "extension_type.h" -#include "helpers.h" -#include "pyarrow.h" #include "arrow/util/checked_cast.h" #include "arrow/util/logging.h" +#include "arrow/python/extension_type.h" +#include "arrow/python/helpers.h" +#include "arrow/python/pyarrow.h" namespace arrow { diff --git a/python/pyarrow/src/extension_type.h b/python/pyarrow/src/arrow/python/extension_type.h similarity index 97% rename from python/pyarrow/src/extension_type.h rename to python/pyarrow/src/arrow/python/extension_type.h index 76ddb3277338..7fc86b99c962 100644 --- a/python/pyarrow/src/extension_type.h +++ b/python/pyarrow/src/arrow/python/extension_type.h @@ -21,9 +21,9 @@ #include #include "arrow/extension_type.h" -#include "common.h" -#include "visibility.h" #include "arrow/util/macros.h" +#include "arrow/python/common.h" +#include "arrow/python/visibility.h" namespace arrow { namespace py { diff --git a/python/pyarrow/src/filesystem.cc b/python/pyarrow/src/arrow/python/filesystem.cc similarity index 99% rename from python/pyarrow/src/filesystem.cc rename to python/pyarrow/src/arrow/python/filesystem.cc index 17ca732e073d..2ad76341f602 100644 --- a/python/pyarrow/src/filesystem.cc +++ b/python/pyarrow/src/arrow/python/filesystem.cc @@ -15,8 +15,8 @@ // specific language governing permissions and limitations // under the License. -#include "filesystem.h" #include "arrow/util/logging.h" +#include "arrow/python/filesystem.h" namespace arrow { diff --git a/python/pyarrow/src/filesystem.h b/python/pyarrow/src/arrow/python/filesystem.h similarity index 98% rename from python/pyarrow/src/filesystem.h rename to python/pyarrow/src/arrow/python/filesystem.h index 993145b53279..2e5b2237bbed 100644 --- a/python/pyarrow/src/filesystem.h +++ b/python/pyarrow/src/arrow/python/filesystem.h @@ -22,9 +22,9 @@ #include #include "arrow/filesystem/filesystem.h" -#include "common.h" -#include "visibility.h" #include "arrow/util/macros.h" +#include "arrow/python/common.h" +#include "arrow/python/visibility.h" namespace arrow { namespace py { diff --git a/python/pyarrow/src/flight.cc b/python/pyarrow/src/arrow/python/flight.cc similarity index 99% rename from python/pyarrow/src/flight.cc rename to python/pyarrow/src/arrow/python/flight.cc index 79b8db074a5e..6e266b7f9d89 100644 --- a/python/pyarrow/src/flight.cc +++ b/python/pyarrow/src/arrow/python/flight.cc @@ -18,9 +18,9 @@ #include #include -#include "flight.h" #include "arrow/util/io_util.h" #include "arrow/util/logging.h" +#include "arrow/python/flight.h" using arrow::flight::FlightPayload; diff --git a/python/pyarrow/src/flight.h b/python/pyarrow/src/arrow/python/flight.h similarity index 99% rename from python/pyarrow/src/flight.h rename to python/pyarrow/src/arrow/python/flight.h index 37bc1d1c9f28..82d93711e55f 100644 --- a/python/pyarrow/src/flight.h +++ b/python/pyarrow/src/arrow/python/flight.h @@ -23,7 +23,7 @@ #include "arrow/flight/api.h" #include "arrow/ipc/dictionary.h" -#include "common.h" +#include "arrow/python/common.h" #if defined(_WIN32) || defined(__CYGWIN__) // Windows #if defined(_MSC_VER) diff --git a/python/pyarrow/src/gdb.cc b/python/pyarrow/src/arrow/python/gdb.cc similarity index 99% rename from python/pyarrow/src/gdb.cc rename to python/pyarrow/src/arrow/python/gdb.cc index 16530a032d71..746fbdc1823b 100644 --- a/python/pyarrow/src/gdb.cc +++ b/python/pyarrow/src/arrow/python/gdb.cc @@ -24,7 +24,6 @@ #include "arrow/datum.h" #include "arrow/extension_type.h" #include "arrow/ipc/json_simple.h" -#include "gdb.h" #include "arrow/record_batch.h" #include "arrow/scalar.h" #include "arrow/table.h" @@ -34,6 +33,7 @@ #include "arrow/util/key_value_metadata.h" #include "arrow/util/logging.h" #include "arrow/util/macros.h" +#include "arrow/python/gdb.h" namespace arrow { diff --git a/python/pyarrow/src/gdb.h b/python/pyarrow/src/arrow/python/gdb.h similarity index 96% rename from python/pyarrow/src/gdb.h rename to python/pyarrow/src/arrow/python/gdb.h index b4296abe6ddc..1ddcbb51f6e0 100644 --- a/python/pyarrow/src/gdb.h +++ b/python/pyarrow/src/arrow/python/gdb.h @@ -17,7 +17,7 @@ #pragma once -#include "visibility.h" +#include "arrow/python/visibility.h" namespace arrow { namespace gdb { diff --git a/python/pyarrow/src/helpers.cc b/python/pyarrow/src/arrow/python/helpers.cc similarity index 99% rename from python/pyarrow/src/helpers.cc rename to python/pyarrow/src/arrow/python/helpers.cc index 73d7cd8dcfc6..5dd73a0d8d0f 100644 --- a/python/pyarrow/src/helpers.cc +++ b/python/pyarrow/src/arrow/python/helpers.cc @@ -16,20 +16,20 @@ // under the License. // helpers.h includes a NumPy header, so we include this first -#include "numpy_interop.h" +#include "arrow/python/numpy_interop.h" -#include "helpers.h" +#include "arrow/python/helpers.h" #include #include #include #include -#include "common.h" -#include "decimal.h" #include "arrow/type_fwd.h" #include "arrow/util/checked_cast.h" #include "arrow/util/logging.h" +#include "arrow/python/common.h" +#include "arrow/python/decimal.h" namespace arrow { diff --git a/python/pyarrow/src/helpers.h b/python/pyarrow/src/arrow/python/helpers.h similarity index 97% rename from python/pyarrow/src/helpers.h rename to python/pyarrow/src/arrow/python/helpers.h index 089d1225dd6a..84455d2fe177 100644 --- a/python/pyarrow/src/helpers.h +++ b/python/pyarrow/src/arrow/python/helpers.h @@ -17,20 +17,20 @@ #pragma once -#include "platform.h" +#include "arrow/python/platform.h" #include #include #include #include -#include "numpy_interop.h" +#include "arrow/python/numpy_interop.h" #include -#include "visibility.h" #include "arrow/type.h" #include "arrow/util/macros.h" +#include "arrow/python/visibility.h" namespace arrow { diff --git a/python/pyarrow/src/inference.cc b/python/pyarrow/src/arrow/python/inference.cc similarity index 98% rename from python/pyarrow/src/inference.cc rename to python/pyarrow/src/arrow/python/inference.cc index 513b0bfdbbbc..db5f0896a95b 100644 --- a/python/pyarrow/src/inference.cc +++ b/python/pyarrow/src/arrow/python/inference.cc @@ -15,8 +15,8 @@ // specific language governing permissions and limitations // under the License. -#include "inference.h" -#include "numpy_interop.h" +#include "arrow/python/inference.h" +#include "arrow/python/numpy_interop.h" #include @@ -31,11 +31,11 @@ #include "arrow/util/decimal.h" #include "arrow/util/logging.h" -#include "datetime.h" -#include "decimal.h" -#include "helpers.h" -#include "iterators.h" -#include "numpy_convert.h" +#include "arrow/python/datetime.h" +#include "arrow/python/decimal.h" +#include "arrow/python/helpers.h" +#include "arrow/python/iterators.h" +#include "arrow/python/numpy_convert.h" namespace arrow { namespace py { diff --git a/python/pyarrow/src/inference.h b/python/pyarrow/src/arrow/python/inference.h similarity index 96% rename from python/pyarrow/src/inference.h rename to python/pyarrow/src/arrow/python/inference.h index 24005dd96f15..1d6516bcc72b 100644 --- a/python/pyarrow/src/inference.h +++ b/python/pyarrow/src/arrow/python/inference.h @@ -20,13 +20,13 @@ #pragma once -#include "platform.h" +#include "arrow/python/platform.h" #include -#include "visibility.h" #include "arrow/type.h" #include "arrow/util/macros.h" +#include "arrow/python/visibility.h" #include "common.h" diff --git a/python/pyarrow/src/init.cc b/python/pyarrow/src/arrow/python/init.cc similarity index 93% rename from python/pyarrow/src/init.cc rename to python/pyarrow/src/arrow/python/init.cc index f09c5cd12a5a..dba293bbe236 100644 --- a/python/pyarrow/src/init.cc +++ b/python/pyarrow/src/arrow/python/init.cc @@ -18,7 +18,7 @@ // Trigger the array import (inversion of NO_IMPORT_ARRAY) #define NUMPY_IMPORT_ARRAY -#include "init.h" -#include "numpy_interop.h" +#include "arrow/python/init.h" +#include "arrow/python/numpy_interop.h" int arrow_init_numpy() { return arrow::py::import_numpy(); } diff --git a/python/pyarrow/src/init.h b/python/pyarrow/src/arrow/python/init.h similarity index 92% rename from python/pyarrow/src/init.h rename to python/pyarrow/src/arrow/python/init.h index eab467b631e7..2e6c954862bd 100644 --- a/python/pyarrow/src/init.h +++ b/python/pyarrow/src/arrow/python/init.h @@ -17,8 +17,8 @@ #pragma once -#include "platform.h" -#include "visibility.h" +#include "arrow/python/platform.h" +#include "arrow/python/visibility.h" extern "C" { ARROW_PYTHON_EXPORT diff --git a/python/pyarrow/src/io.cc b/python/pyarrow/src/arrow/python/io.cc similarity index 99% rename from python/pyarrow/src/io.cc rename to python/pyarrow/src/arrow/python/io.cc index 0aa2c85939fa..43f8297c5a7e 100644 --- a/python/pyarrow/src/io.cc +++ b/python/pyarrow/src/arrow/python/io.cc @@ -28,8 +28,8 @@ #include "arrow/status.h" #include "arrow/util/logging.h" -#include "common.h" -#include "pyarrow.h" +#include "arrow/python/common.h" +#include "arrow/python/pyarrow.h" namespace arrow { diff --git a/python/pyarrow/src/io.h b/python/pyarrow/src/arrow/python/io.h similarity index 98% rename from python/pyarrow/src/io.h rename to python/pyarrow/src/arrow/python/io.h index 9d79d566efeb..10489c1351b5 100644 --- a/python/pyarrow/src/io.h +++ b/python/pyarrow/src/arrow/python/io.h @@ -22,8 +22,8 @@ #include "arrow/io/interfaces.h" #include "arrow/io/transform.h" -#include "common.h" -#include "visibility.h" +#include "arrow/python/common.h" +#include "arrow/python/visibility.h" namespace arrow { namespace py { diff --git a/python/pyarrow/src/ipc.cc b/python/pyarrow/src/arrow/python/ipc.cc similarity index 98% rename from python/pyarrow/src/ipc.cc rename to python/pyarrow/src/arrow/python/ipc.cc index bed3da2d1ac5..93481822475d 100644 --- a/python/pyarrow/src/ipc.cc +++ b/python/pyarrow/src/arrow/python/ipc.cc @@ -19,7 +19,7 @@ #include -#include "pyarrow.h" +#include "arrow/python/pyarrow.h" namespace arrow { namespace py { diff --git a/python/pyarrow/src/ipc.h b/python/pyarrow/src/arrow/python/ipc.h similarity index 95% rename from python/pyarrow/src/ipc.h rename to python/pyarrow/src/arrow/python/ipc.h index 38839af82fd8..57eabfed0505 100644 --- a/python/pyarrow/src/ipc.h +++ b/python/pyarrow/src/arrow/python/ipc.h @@ -19,11 +19,11 @@ #include -#include "common.h" -#include "visibility.h" #include "arrow/record_batch.h" #include "arrow/result.h" #include "arrow/util/macros.h" +#include "arrow/python/common.h" +#include "arrow/python/visibility.h" namespace arrow { namespace py { diff --git a/python/pyarrow/src/iterators.h b/python/pyarrow/src/arrow/python/iterators.h similarity index 98% rename from python/pyarrow/src/iterators.h rename to python/pyarrow/src/arrow/python/iterators.h index d581adf52c96..7b31962dac5b 100644 --- a/python/pyarrow/src/iterators.h +++ b/python/pyarrow/src/arrow/python/iterators.h @@ -21,8 +21,8 @@ #include "arrow/array/array_primitive.h" -#include "common.h" -#include "numpy_internal.h" +#include "arrow/python/common.h" +#include "arrow/python/numpy_internal.h" namespace arrow { namespace py { diff --git a/python/pyarrow/src/numpy_convert.cc b/python/pyarrow/src/arrow/python/numpy_convert.cc similarity index 99% rename from python/pyarrow/src/numpy_convert.cc rename to python/pyarrow/src/arrow/python/numpy_convert.cc index d8e10605daac..49706807644d 100644 --- a/python/pyarrow/src/numpy_convert.cc +++ b/python/pyarrow/src/arrow/python/numpy_convert.cc @@ -15,9 +15,9 @@ // specific language governing permissions and limitations // under the License. -#include "numpy_interop.h" +#include "arrow/python/numpy_interop.h" -#include "numpy_convert.h" +#include "arrow/python/numpy_convert.h" #include #include @@ -30,9 +30,9 @@ #include "arrow/type.h" #include "arrow/util/logging.h" -#include "common.h" -#include "pyarrow.h" -#include "type_traits.h" +#include "arrow/python/common.h" +#include "arrow/python/pyarrow.h" +#include "arrow/python/type_traits.h" namespace arrow { namespace py { diff --git a/python/pyarrow/src/numpy_convert.h b/python/pyarrow/src/arrow/python/numpy_convert.h similarity index 98% rename from python/pyarrow/src/numpy_convert.h rename to python/pyarrow/src/arrow/python/numpy_convert.h index d2772dcdcdf2..69a7dd3323b0 100644 --- a/python/pyarrow/src/numpy_convert.h +++ b/python/pyarrow/src/arrow/python/numpy_convert.h @@ -20,15 +20,15 @@ #pragma once -#include "platform.h" +#include "arrow/python/platform.h" #include #include #include #include "arrow/buffer.h" -#include "visibility.h" #include "arrow/sparse_tensor.h" +#include "arrow/python/visibility.h" namespace arrow { diff --git a/python/pyarrow/src/numpy_internal.h b/python/pyarrow/src/arrow/python/numpy_internal.h similarity index 98% rename from python/pyarrow/src/numpy_internal.h rename to python/pyarrow/src/arrow/python/numpy_internal.h index d408e908442b..b9b632f9f9a1 100644 --- a/python/pyarrow/src/numpy_internal.h +++ b/python/pyarrow/src/arrow/python/numpy_internal.h @@ -19,11 +19,11 @@ #pragma once -#include "numpy_interop.h" +#include "arrow/python/numpy_interop.h" #include "arrow/status.h" -#include "platform.h" +#include "arrow/python/platform.h" #include #include diff --git a/python/pyarrow/src/numpy_interop.h b/python/pyarrow/src/arrow/python/numpy_interop.h similarity index 98% rename from python/pyarrow/src/numpy_interop.h rename to python/pyarrow/src/arrow/python/numpy_interop.h index d212e014ec6f..ce7baed259f9 100644 --- a/python/pyarrow/src/numpy_interop.h +++ b/python/pyarrow/src/arrow/python/numpy_interop.h @@ -17,7 +17,7 @@ #pragma once -#include "platform.h" // IWYU pragma: export +#include "arrow/python/platform.h" // IWYU pragma: export #include // IWYU pragma: export diff --git a/python/pyarrow/src/numpy_to_arrow.cc b/python/pyarrow/src/arrow/python/numpy_to_arrow.cc similarity index 98% rename from python/pyarrow/src/numpy_to_arrow.cc rename to python/pyarrow/src/arrow/python/numpy_to_arrow.cc index cd01577d71dc..2727ce32f449 100644 --- a/python/pyarrow/src/numpy_to_arrow.cc +++ b/python/pyarrow/src/arrow/python/numpy_to_arrow.cc @@ -17,8 +17,8 @@ // Functions for pandas conversion via NumPy -#include "numpy_to_arrow.h" -#include "numpy_interop.h" +#include "arrow/python/numpy_to_arrow.h" +#include "arrow/python/numpy_interop.h" #include #include @@ -49,14 +49,14 @@ #include "arrow/compute/api_scalar.h" -#include "common.h" -#include "datetime.h" -#include "helpers.h" -#include "iterators.h" -#include "numpy_convert.h" -#include "numpy_internal.h" -#include "python_to_arrow.h" -#include "type_traits.h" +#include "arrow/python/common.h" +#include "arrow/python/datetime.h" +#include "arrow/python/helpers.h" +#include "arrow/python/iterators.h" +#include "arrow/python/numpy_convert.h" +#include "arrow/python/numpy_internal.h" +#include "arrow/python/python_to_arrow.h" +#include "arrow/python/type_traits.h" namespace arrow { diff --git a/python/pyarrow/src/numpy_to_arrow.h b/python/pyarrow/src/arrow/python/numpy_to_arrow.h similarity index 97% rename from python/pyarrow/src/numpy_to_arrow.h rename to python/pyarrow/src/arrow/python/numpy_to_arrow.h index 13924b1ac1ca..b6cd093e5542 100644 --- a/python/pyarrow/src/numpy_to_arrow.h +++ b/python/pyarrow/src/arrow/python/numpy_to_arrow.h @@ -19,12 +19,12 @@ #pragma once -#include "platform.h" +#include "arrow/python/platform.h" #include #include "arrow/compute/api.h" -#include "visibility.h" +#include "arrow/python/visibility.h" namespace arrow { diff --git a/python/pyarrow/src/parquet_encryption.cc b/python/pyarrow/src/arrow/python/parquet_encryption.cc similarity index 98% rename from python/pyarrow/src/parquet_encryption.cc rename to python/pyarrow/src/arrow/python/parquet_encryption.cc index b64c77f2b9fc..a5f924bce783 100644 --- a/python/pyarrow/src/parquet_encryption.cc +++ b/python/pyarrow/src/arrow/python/parquet_encryption.cc @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. -#include "parquet_encryption.h" +#include "arrow/python/parquet_encryption.h" #include "parquet/exception.h" namespace arrow { diff --git a/python/pyarrow/src/parquet_encryption.h b/python/pyarrow/src/arrow/python/parquet_encryption.h similarity index 98% rename from python/pyarrow/src/parquet_encryption.h rename to python/pyarrow/src/arrow/python/parquet_encryption.h index 0079b6eed569..23ee478348ec 100644 --- a/python/pyarrow/src/parquet_encryption.h +++ b/python/pyarrow/src/arrow/python/parquet_encryption.h @@ -19,8 +19,8 @@ #include -#include "common.h" -#include "visibility.h" +#include "arrow/python/common.h" +#include "arrow/python/visibility.h" #include "arrow/util/macros.h" #include "parquet/encryption/crypto_factory.h" #include "parquet/encryption/kms_client.h" diff --git a/python/pyarrow/src/pch.h b/python/pyarrow/src/arrow/python/pch.h similarity index 96% rename from python/pyarrow/src/pch.h rename to python/pyarrow/src/arrow/python/pch.h index 0afcf7938dfc..d1d688b4f17c 100644 --- a/python/pyarrow/src/pch.h +++ b/python/pyarrow/src/arrow/python/pch.h @@ -21,4 +21,4 @@ // may incur a slowdown, since it makes the precompiled header heavier to load. #include "arrow/pch.h" -#include "platform.h" +#include "arrow/python/platform.h" diff --git a/python/pyarrow/src/platform.h b/python/pyarrow/src/arrow/python/platform.h similarity index 100% rename from python/pyarrow/src/platform.h rename to python/pyarrow/src/arrow/python/platform.h diff --git a/python/pyarrow/src/pyarrow.cc b/python/pyarrow/src/arrow/python/pyarrow.cc similarity index 95% rename from python/pyarrow/src/pyarrow.cc rename to python/pyarrow/src/arrow/python/pyarrow.cc index b567a68df3e2..c3244b74bf51 100644 --- a/python/pyarrow/src/pyarrow.cc +++ b/python/pyarrow/src/arrow/python/pyarrow.cc @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. -#include "pyarrow.h" +#include "arrow/python/pyarrow.h" #include #include @@ -25,10 +25,10 @@ #include "arrow/tensor.h" #include "arrow/type.h" -#include "common.h" -#include "datetime.h" +#include "arrow/python/common.h" +#include "arrow/python/datetime.h" namespace { -#include "pyarrow_api.h" +#include "arrow/python/pyarrow_api.h" } namespace arrow { diff --git a/python/pyarrow/src/pyarrow.h b/python/pyarrow/src/arrow/python/pyarrow.h similarity index 97% rename from python/pyarrow/src/pyarrow.h rename to python/pyarrow/src/arrow/python/pyarrow.h index a63e29a33fb7..4c365081d70c 100644 --- a/python/pyarrow/src/pyarrow.h +++ b/python/pyarrow/src/arrow/python/pyarrow.h @@ -17,11 +17,11 @@ #pragma once -#include "platform.h" +#include "arrow/python/platform.h" #include -#include "visibility.h" +#include "arrow/python/visibility.h" #include "arrow/sparse_tensor.h" diff --git a/python/pyarrow/src/pyarrow_api.h b/python/pyarrow/src/arrow/python/pyarrow_api.h similarity index 100% rename from python/pyarrow/src/pyarrow_api.h rename to python/pyarrow/src/arrow/python/pyarrow_api.h diff --git a/python/pyarrow/src/pyarrow_lib.h b/python/pyarrow/src/arrow/python/pyarrow_lib.h similarity index 100% rename from python/pyarrow/src/pyarrow_lib.h rename to python/pyarrow/src/arrow/python/pyarrow_lib.h diff --git a/python/pyarrow/src/python_test.cc b/python/pyarrow/src/arrow/python/python_test.cc similarity index 99% rename from python/pyarrow/src/python_test.cc rename to python/pyarrow/src/arrow/python/python_test.cc index 589110a286c3..9b84488eb306 100644 --- a/python/pyarrow/src/python_test.cc +++ b/python/pyarrow/src/arrow/python/python_test.cc @@ -28,13 +28,13 @@ #include "arrow/util/decimal.h" #include "arrow/util/logging.h" -#include "arrow_to_pandas.h" -#include "decimal.h" -#include "helpers.h" -#include "numpy_convert.h" -#include "numpy_interop.h" -#include "python_test.h" -#include "python_to_arrow.h" +#include "arrow/python/arrow_to_pandas.h" +#include "arrow/python/decimal.h" +#include "arrow/python/helpers.h" +#include "arrow/python/numpy_convert.h" +#include "arrow/python/numpy_interop.h" +#include "arrow/python/python_test.h" +#include "arrow/python/python_to_arrow.h" #define ASSERT_EQ(x, y) { \ auto&& _left = (x); \ diff --git a/python/pyarrow/src/python_test.h b/python/pyarrow/src/arrow/python/python_test.h similarity index 96% rename from python/pyarrow/src/python_test.h rename to python/pyarrow/src/arrow/python/python_test.h index db0f7ed31346..c2eb62fc29ac 100644 --- a/python/pyarrow/src/python_test.h +++ b/python/pyarrow/src/arrow/python/python_test.h @@ -23,7 +23,7 @@ #include "arrow/status.h" -#include "visibility.h" +#include "arrow/python/visibility.h" namespace arrow { namespace py { diff --git a/python/pyarrow/src/python_to_arrow.cc b/python/pyarrow/src/arrow/python/python_to_arrow.cc similarity index 99% rename from python/pyarrow/src/python_to_arrow.cc rename to python/pyarrow/src/arrow/python/python_to_arrow.cc index 4ca19049a738..3a43caed11fa 100644 --- a/python/pyarrow/src/python_to_arrow.cc +++ b/python/pyarrow/src/arrow/python/python_to_arrow.cc @@ -15,8 +15,8 @@ // specific language governing permissions and limitations // under the License. -#include "python_to_arrow.h" -#include "numpy_interop.h" +#include "arrow/python/python_to_arrow.h" +#include "arrow/python/numpy_interop.h" #include @@ -44,14 +44,14 @@ #include "arrow/util/int_util_overflow.h" #include "arrow/util/logging.h" -#include "datetime.h" -#include "decimal.h" -#include "helpers.h" -#include "inference.h" -#include "iterators.h" -#include "numpy_convert.h" -#include "type_traits.h" #include "arrow/visit_type_inline.h" +#include "arrow/python/datetime.h" +#include "arrow/python/decimal.h" +#include "arrow/python/helpers.h" +#include "arrow/python/inference.h" +#include "arrow/python/iterators.h" +#include "arrow/python/numpy_convert.h" +#include "arrow/python/type_traits.h" namespace arrow { diff --git a/python/pyarrow/src/python_to_arrow.h b/python/pyarrow/src/arrow/python/python_to_arrow.h similarity index 95% rename from python/pyarrow/src/python_to_arrow.h rename to python/pyarrow/src/arrow/python/python_to_arrow.h index ca246a87401e..d737047a00b8 100644 --- a/python/pyarrow/src/python_to_arrow.h +++ b/python/pyarrow/src/arrow/python/python_to_arrow.h @@ -20,16 +20,16 @@ #pragma once -#include "platform.h" +#include "arrow/python/platform.h" #include #include -#include "visibility.h" #include "arrow/type.h" #include "arrow/util/macros.h" +#include "arrow/python/visibility.h" -#include "common.h" +#include "arrow/python/common.h" namespace arrow { diff --git a/python/pyarrow/src/serialize.cc b/python/pyarrow/src/arrow/python/serialize.cc similarity index 99% rename from python/pyarrow/src/serialize.cc rename to python/pyarrow/src/arrow/python/serialize.cc index c7c925fa1980..ad079cbd9c70 100644 --- a/python/pyarrow/src/serialize.cc +++ b/python/pyarrow/src/arrow/python/serialize.cc @@ -15,8 +15,8 @@ // specific language governing permissions and limitations // under the License. -#include "serialize.h" -#include "numpy_interop.h" +#include "arrow/python/serialize.h" +#include "arrow/python/numpy_interop.h" #include #include @@ -42,13 +42,13 @@ #include "arrow/tensor.h" #include "arrow/util/logging.h" -#include "common.h" -#include "datetime.h" -#include "helpers.h" -#include "iterators.h" -#include "numpy_convert.h" -#include "platform.h" -#include "pyarrow.h" +#include "arrow/python/common.h" +#include "arrow/python/datetime.h" +#include "arrow/python/helpers.h" +#include "arrow/python/iterators.h" +#include "arrow/python/numpy_convert.h" +#include "arrow/python/platform.h" +#include "arrow/python/pyarrow.h" constexpr int32_t kMaxRecursionDepth = 100; diff --git a/python/pyarrow/src/serialize.h b/python/pyarrow/src/arrow/python/serialize.h similarity index 99% rename from python/pyarrow/src/serialize.h rename to python/pyarrow/src/arrow/python/serialize.h index fd78c9a309ad..e9fd8438815b 100644 --- a/python/pyarrow/src/serialize.h +++ b/python/pyarrow/src/arrow/python/serialize.h @@ -21,9 +21,9 @@ #include #include "arrow/ipc/options.h" -#include "visibility.h" #include "arrow/sparse_tensor.h" #include "arrow/status.h" +#include "arrow/python/visibility.h" // Forward declaring PyObject, see // https://mail.python.org/pipermail/python-dev/2003-August/037601.html diff --git a/python/pyarrow/src/type_traits.h b/python/pyarrow/src/arrow/python/type_traits.h similarity index 99% rename from python/pyarrow/src/type_traits.h rename to python/pyarrow/src/arrow/python/type_traits.h index 4cdfe9d8d62b..a941577f7655 100644 --- a/python/pyarrow/src/type_traits.h +++ b/python/pyarrow/src/arrow/python/type_traits.h @@ -19,12 +19,12 @@ #pragma once -#include "platform.h" +#include "arrow/python/platform.h" #include #include -#include "numpy_interop.h" +#include "arrow/python/numpy_interop.h" #include diff --git a/python/pyarrow/src/udf.cc b/python/pyarrow/src/arrow/python/udf.cc similarity index 98% rename from python/pyarrow/src/udf.cc rename to python/pyarrow/src/arrow/python/udf.cc index 51cea5e6c64a..81bf47c0ade0 100644 --- a/python/pyarrow/src/udf.cc +++ b/python/pyarrow/src/arrow/python/udf.cc @@ -15,9 +15,9 @@ // specific language governing permissions and limitations // under the License. -#include "udf.h" +#include "arrow/python/udf.h" #include "arrow/compute/function.h" -#include "common.h" +#include "arrow/python/common.h" namespace arrow { diff --git a/python/pyarrow/src/udf.h b/python/pyarrow/src/arrow/python/udf.h similarity index 93% rename from python/pyarrow/src/udf.h rename to python/pyarrow/src/arrow/python/udf.h index a110440315ac..9a3666459fd8 100644 --- a/python/pyarrow/src/udf.h +++ b/python/pyarrow/src/arrow/python/udf.h @@ -20,11 +20,11 @@ #include "arrow/compute/exec.h" #include "arrow/compute/function.h" #include "arrow/compute/registry.h" -#include "platform.h" +#include "arrow/python/platform.h" -#include "common.h" -#include "pyarrow.h" -#include "visibility.h" +#include "arrow/python/common.h" +#include "arrow/python/pyarrow.h" +#include "arrow/python/visibility.h" namespace arrow { diff --git a/python/pyarrow/src/visibility.h b/python/pyarrow/src/arrow/python/visibility.h similarity index 100% rename from python/pyarrow/src/visibility.h rename to python/pyarrow/src/arrow/python/visibility.h