This is an automated email from the ASF dual-hosted git repository.
kou pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/arrow.git
The following commit(s) were added to refs/heads/main by this push:
new 9bd0ddb4bf GH-41725: [Python] CMake: ignore Parquet encryption option
if Parquet itself is not enabled (fix Java integration build) (#41776)
9bd0ddb4bf is described below
commit 9bd0ddb4bf10a70101fa0c59dd881179dfd76994
Author: Joris Van den Bossche <[email protected]>
AuthorDate: Wed May 22 23:03:38 2024 +0200
GH-41725: [Python] CMake: ignore Parquet encryption option if Parquet
itself is not enabled (fix Java integration build) (#41776)
### Rationale for this change
Because of refactoring in https://github.com/apache/arrow/issues/41480,
explicitly enabling `PYARROW_WITH_PARQUET_ENCRYPTION` without enabling
`PYARROW_WITH_PARQUET` (and without Arrow C++ being built with Parquet support)
now raises an error, while before we checked in `setup.py` that both were
enabled for enabling encryption support. This patch mimics that logic in
CMakeLists.txt with a warning added.
### What changes are included in this PR?
When PyArrow with Parquet Encryption is enabled but PyArrow with Parquet
itself is not, ignore the encryption setting, but warn about it.
### Are these changes tested?
Yes
* GitHub Issue: #41725
Authored-by: Joris Van den Bossche <[email protected]>
Signed-off-by: Sutou Kouhei <[email protected]>
---
python/CMakeLists.txt | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/python/CMakeLists.txt b/python/CMakeLists.txt
index 07acb9e31a..a8bbed1171 100644
--- a/python/CMakeLists.txt
+++ b/python/CMakeLists.txt
@@ -370,12 +370,18 @@ if(PYARROW_BUILD_ACERO)
endif()
endif()
-if(PYARROW_BUILD_PARQUET OR PYARROW_BUILD_PARQUET_ENCRYPTION)
+if(PYARROW_BUILD_PARQUET)
message(STATUS "Building PyArrow with Parquet")
if(NOT ARROW_PARQUET)
message(FATAL_ERROR "You must build Arrow C++ with ARROW_PARQUET=ON")
endif()
find_package(Parquet REQUIRED)
+else()
+ if(PYARROW_BUILD_PARQUET_ENCRYPTION)
+ message(WARNING "Building PyArrow with Parquet Encryption is requested,
but Parquet itself is not enabled. Ignoring the Parquet Encryption setting."
+ )
+ set(PYARROW_BUILD_PARQUET_ENCRYPTION OFF)
+ endif()
endif()
# Check for only Arrow C++ options