From 00e9f8d870a2d41b75c8f790ddd5c08d78ac2b53 Mon Sep 17 00:00:00 2001 From: Philipp Moritz Date: Sun, 13 Jan 2019 14:28:23 -0800 Subject: [PATCH] Fix pyarrow version (#3760) --- cmake/Modules/ArrowExternalProject.cmake | 3 +++ cmake/Modules/BoostExternalProject.cmake | 2 +- cmake/Modules/ThirdpartyToolchain.cmake | 1 + python/build-wheel-macos.sh | 2 +- test/runtest.py | 15 +++++++++++++++ 5 files changed, 21 insertions(+), 2 deletions(-) diff --git a/cmake/Modules/ArrowExternalProject.cmake b/cmake/Modules/ArrowExternalProject.cmake index 67d09686b..3387c70bd 100644 --- a/cmake/Modules/ArrowExternalProject.cmake +++ b/cmake/Modules/ArrowExternalProject.cmake @@ -22,6 +22,9 @@ set(arrow_URL https://github.com/ray-project/arrow.git) # the patch is available at # https://github.com/ray-project/arrow/commit/c347cd571e51723fc8512922f1b3a8e45e45b169 # See the discussion in https://github.com/apache/arrow/pull/3177 +# WARNING: If the arrow version is updated, you need to also update the +# SETUPTOOLS_SCM_PRETEND_VERSION version string in the ThirdpartyToolchain.cmake +# file set(arrow_TAG c347cd571e51723fc8512922f1b3a8e45e45b169) set(ARROW_INSTALL_PREFIX ${CMAKE_CURRENT_BINARY_DIR}/external/arrow-install) diff --git a/cmake/Modules/BoostExternalProject.cmake b/cmake/Modules/BoostExternalProject.cmake index e37f0e463..b5b19cd2f 100644 --- a/cmake/Modules/BoostExternalProject.cmake +++ b/cmake/Modules/BoostExternalProject.cmake @@ -64,6 +64,6 @@ if (RAY_BUILD_BOOST) BUILD_IN_SOURCE 1 BUILD_BYPRODUCTS ${Boost_BUILD_PRODUCTS} CONFIGURE_COMMAND ./bootstrap.sh - BUILD_COMMAND bash -c "./b2 cxxflags=-fPIC cflags=-fPIC variant=release link=static --with-filesystem --with-system --with-thread --with-atomic --with-chrono --with-date_time --with-regex -j8 install --prefix=${Boost_INSTALL_PREFIX} > /dev/null" + BUILD_COMMAND bash -c "./b2 cxxflags=\"-fPIC -D_GLIBCXX_USE_CXX11_ABI=0\" cflags=-fPIC variant=release link=static --with-filesystem --with-system --with-thread --with-atomic --with-chrono --with-date_time --with-regex -j8 install --prefix=${Boost_INSTALL_PREFIX} > /dev/null" INSTALL_COMMAND "") endif () diff --git a/cmake/Modules/ThirdpartyToolchain.cmake b/cmake/Modules/ThirdpartyToolchain.cmake index f95a1b290..f97ee1a2d 100644 --- a/cmake/Modules/ThirdpartyToolchain.cmake +++ b/cmake/Modules/ThirdpartyToolchain.cmake @@ -118,6 +118,7 @@ if ("${CMAKE_RAY_LANG_PYTHON}" STREQUAL "YES") # PYARROW_PARALLEL= , so it will add -j to pyarrow build set(pyarrow_ENV + "SETUPTOOLS_SCM_PRETEND_VERSION=0.11.1-RAY" "PKG_CONFIG_PATH=${ARROW_LIBRARY_DIR}/pkgconfig" "PYARROW_WITH_PLASMA=1" "PYARROW_WITH_TENSORFLOW=1" diff --git a/python/build-wheel-macos.sh b/python/build-wheel-macos.sh index 1b29cd774..3b21aacf1 100755 --- a/python/build-wheel-macos.sh +++ b/python/build-wheel-macos.sh @@ -67,7 +67,7 @@ for ((i=0; i<${#PY_VERSIONS[@]}; ++i)); do $PIP_CMD install --upgrade setuptools # Install setuptools_scm because otherwise when building the wheel for # Python 3.6, we see an error. - $PIP_CMD install -q setuptools_scm==2.1.0 + $PIP_CMD install -q setuptools_scm==3.1.0 # Fix the numpy version because this will be the oldest numpy version we can # support. $PIP_CMD install -q numpy==$NUMPY_VERSION cython==0.29.0 diff --git a/test/runtest.py b/test/runtest.py index 5fbe5f20a..1e7af676e 100644 --- a/test/runtest.py +++ b/test/runtest.py @@ -8,9 +8,11 @@ import os import random import re import setproctitle +import shutil import string import subprocess import sys +import tempfile import threading import time from collections import defaultdict, namedtuple, OrderedDict @@ -2585,3 +2587,16 @@ def test_ray_stack(shutdown_only): if not success: raise Exception("Failed to find necessary information with " "'ray stack'") + + +def test_pandas_parquet_serialization(): + # Only test this if pandas is installed + pytest.importorskip("pandas") + + import pandas as pd + + tempdir = tempfile.mkdtemp() + filename = os.path.join(tempdir, "parquet-test") + pd.DataFrame({"col1": [0, 1], "col2": [0, 1]}).to_parquet(filename) + # Clean up + shutil.rmtree(tempdir)