From 0fea3ed7e649ec8acf23ae91edf2058fe7d9e77e Mon Sep 17 00:00:00 2001 From: Vyas Ramasubramani Date: Tue, 14 May 2024 20:21:13 -0700 Subject: [PATCH] Fix arrow versioning logic (#15755) Resolves #15754 Authors: - Vyas Ramasubramani (https://github.com/vyasr) Approvers: - Bradley Dice (https://github.com/bdice) - GALI PREM SAGAR (https://github.com/galipremsagar) URL: https://github.com/rapidsai/cudf/pull/15755 --- cpp/cmake/thirdparty/get_arrow.cmake | 21 ++++++++++++++------- dependencies.yaml | 4 ++-- python/cudf/pyproject.toml | 2 +- 3 files changed, 17 insertions(+), 10 deletions(-) diff --git a/cpp/cmake/thirdparty/get_arrow.cmake b/cpp/cmake/thirdparty/get_arrow.cmake index e9d2f479088..73e66cce608 100644 --- a/cpp/cmake/thirdparty/get_arrow.cmake +++ b/cpp/cmake/thirdparty/get_arrow.cmake @@ -26,13 +26,20 @@ include_guard(GLOBAL) # pyarrow. function(find_libarrow_in_python_wheel PYARROW_VERSION) string(REPLACE "." ";" PYARROW_VER_COMPONENTS "${PYARROW_VERSION}") - list(GET PYARROW_VER_COMPONENTS 0 PYARROW_SO_VER) - # The soname for Arrow libraries is constructed using the major version plus "00". Note that, - # although it may seem like it due to Arrow almost exclusively releasing new major versions (i.e. - # `${MINOR_VERSION}${PATCH_VERSION}` is almost always equivalent to "00"), - # the soname is not generated by concatenating the major, minor, and patch versions into a single - # version number soname, just `${MAJOR_VERSION}00` - set(PYARROW_LIB "libarrow.so.${PYARROW_SO_VER}00") + list(GET PYARROW_VER_COMPONENTS 0 PYARROW_MAJOR_VER) + list(GET PYARROW_VER_COMPONENTS 1 PYARROW_MINOR_VER) + + # Ensure that the major and minor versions are two digits long + string(LENGTH ${PYARROW_MAJOR_VER} PYARROW_MAJOR_LENGTH) + string(LENGTH ${PYARROW_MINOR_VER} PYARROW_MINOR_LENGTH) + if(${PYARROW_MAJOR_LENGTH} EQUAL 1) + set(PYARROW_MAJOR_VER "0${PYARROW_MAJOR_VER}") + endif() + if(${PYARROW_MINOR_LENGTH} EQUAL 1) + set(PYARROW_MINOR_VER "0${PYARROW_MINOR_VER}") + endif() + + set(PYARROW_LIB "libarrow.so.${PYARROW_MAJOR_VER}${PYARROW_MINOR_VER}") string( APPEND diff --git a/dependencies.yaml b/dependencies.yaml index 27b0f23389c..898760d1351 100644 --- a/dependencies.yaml +++ b/dependencies.yaml @@ -352,8 +352,8 @@ dependencies: common: - output_types: [conda, requirements, pyproject] packages: - # Allow runtime version to float up to minor version - - pyarrow>=16.0.0,<17.0.0a0 + # Allow runtime version to float up to patch version + - pyarrow>=16.0.0,<16.1.0a0 cuda_version: specific: - output_types: conda diff --git a/python/cudf/pyproject.toml b/python/cudf/pyproject.toml index 4b57bcd018a..826362f0632 100644 --- a/python/cudf/pyproject.toml +++ b/python/cudf/pyproject.toml @@ -34,7 +34,7 @@ dependencies = [ "packaging", "pandas>=2.0,<2.2.3dev0", "ptxcompiler", - "pyarrow>=16.0.0,<17.0.0a0", + "pyarrow>=16.0.0,<16.1.0a0", "rich", "rmm==24.6.*", "typing_extensions>=4.0.0",