Skip to content

Apache DataFusion SQL Query Engine

ARROW-6655: [Python] Filesystem bindings for S3

Krisztián Szűcs004168bc2023
diff --git a/.travis.yml b/.travis.yml
index 4fc143a493..990fd22566 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -87,6 +87,7 @@ matrix:
- if [ $ARROW_CI_CPP_AFFECTED != "1" ] && [ $ARROW_CI_JAVA_AFFECTED != "1" ]; then exit; fi
- $TRAVIS_BUILD_DIR/ci/travis_install_clang_tools.sh
- $TRAVIS_BUILD_DIR/ci/travis_install_linux.sh
+ - $TRAVIS_BUILD_DIR/ci/travis_install_minio.sh
# If either C++ or Python changed, we must install the C++ libraries
- git submodule update --init
- $TRAVIS_BUILD_DIR/ci/travis_before_script_cpp.sh
@@ -110,12 +111,14 @@ matrix:
- ARROW_TRAVIS_USE_SYSTEM_JAVA=1
- ARROW_TRAVIS_USE_TOOLCHAIN=1
- ARROW_TRAVIS_VALGRIND=1
+ - ARROW_TRAVIS_S3=1
# TODO(wesm): Run the benchmarks outside of Travis
# - ARROW_TRAVIS_PYTHON_BENCHMARKS=1
before_script:
- if [ $ARROW_CI_PYTHON_AFFECTED != "1" ] && [ $ARROW_CI_DOCS_AFFECTED != "1" ]; then exit; fi
- $TRAVIS_BUILD_DIR/ci/travis_install_clang_tools.sh
- $TRAVIS_BUILD_DIR/ci/travis_install_linux.sh
+ - $TRAVIS_BUILD_DIR/ci/travis_install_minio.sh
- $TRAVIS_BUILD_DIR/ci/travis_install_toolchain.sh
script:
- $TRAVIS_BUILD_DIR/ci/travis_script_java.sh || travis_terminate 1
@@ -136,6 +139,7 @@ matrix:
- ARROW_TRAVIS_PLASMA=1
- ARROW_TRAVIS_FLIGHT=1
- ARROW_TRAVIS_ORC=1
+ - ARROW_TRAVIS_S3=1
- ARROW_TRAVIS_PARQUET=1
# TODO(ARROW-4763): llvm and llvmdev packages are in conflict:
# https://github.com/conda-forge/llvmdev-feedstock/issues/60
@@ -149,6 +153,7 @@ matrix:
- if [ $ARROW_CI_CPP_AFFECTED != "1" ] && [ $ARROW_CI_JAVA_AFFECTED != "1" ]; then exit; fi
# If either C++ or Python changed, we must install the C++ libraries
- git submodule update --init
+ - $TRAVIS_BUILD_DIR/ci/travis_install_minio.sh
- $TRAVIS_BUILD_DIR/ci/travis_before_script_cpp.sh
script:
- $TRAVIS_BUILD_DIR/ci/travis_script_cpp.sh || travis_terminate 1
@@ -161,6 +166,7 @@ matrix:
cache:
addons:
env:
+ - ARROW_TRAVIS_S3=1
- ARROW_TRAVIS_PLASMA=1
- ARROW_TRAVIS_USE_TOOLCHAIN=1
- ARROW_BUILD_WARNING_LEVEL=CHECKIN
@@ -170,6 +176,7 @@ matrix:
before_script:
script:
- if [ $ARROW_CI_PYTHON_AFFECTED != "1" ]; then exit; fi
+ - $TRAVIS_BUILD_DIR/ci/travis_install_minio.sh
- $TRAVIS_BUILD_DIR/ci/travis_script_python.sh 3.6
- name: "Java OpenJDK8 and OpenJDK11"
language: cpp
diff --git a/ci/conda_env_python.yml b/ci/conda_env_python.yml
index a0cd737b32..0e6e5bf8d5 100644
--- a/ci/conda_env_python.yml
+++ b/ci/conda_env_python.yml
@@ -22,6 +22,7 @@ numpy>=1.14
pandas
pytest
pytest-faulthandler
+pytest-lazy-fixture
pytz
setuptools
setuptools_scm=3.2.0
diff --git a/ci/cpp-msvc-build-main.bat b/ci/cpp-msvc-build-main.bat
index b088e2eec7..b6d1b20a51 100644
--- a/ci/cpp-msvc-build-main.bat
+++ b/ci/cpp-msvc-build-main.bat
@@ -98,6 +98,9 @@ pip install -r requirements.txt pickle5
set PYARROW_CXXFLAGS=%ARROW_CXXFLAGS%
set PYARROW_CMAKE_GENERATOR=%GENERATOR%
+if "%ARROW_S3%" == "ON" (
+ set PYARROW_WITH_S3=ON
+)
if "%ARROW_BUILD_FLIGHT%" == "ON" (
@rem ARROW-5441: bundling Arrow Flight libraries not implemented
set PYARROW_BUNDLE_ARROW_CPP=OFF
diff --git a/ci/travis_install_linux.sh b/ci/travis_install_linux.sh
index a5283139a8..441d50d9b1 100755
--- a/ci/travis_install_linux.sh
+++ b/ci/travis_install_linux.sh
@@ -42,14 +42,6 @@ if [ "$ARROW_TRAVIS_GANDIVA" == "1" ]; then
sudo apt-get install -y -qq llvm-$ARROW_LLVM_MAJOR_VERSION-dev
fi
-if [ "$ARROW_TRAVIS_S3" == "1" ]; then
- # Download the Minio S3 server into PATH
- S3FS_DIR=~/.local/bin/
- mkdir -p $S3FS_DIR
- wget --directory-prefix $S3FS_DIR https://dl.min.io/server/minio/release/linux-amd64/minio
- chmod +x $S3FS_DIR/minio
-fi
-
if [ "$ARROW_TRAVIS_USE_SYSTEM" == "1" ]; then
if [ "$DISTRO_CODENAME" == "xenial" ]; then
# TODO(ARROW-4761): Install libzstd-dev once we support zstd<1
diff --git a/ci/travis_install_minio.sh b/ci/travis_install_minio.sh
new file mode 100755
index 0000000000..5459bb8bfc
--- /dev/null
+++ b/ci/travis_install_minio.sh
@@ -0,0 +1,35 @@
+#!/usr/bin/env bash
+
+# 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.
+
+set -e
+set -x
+
+if [ "$ARROW_TRAVIS_S3" == "1" ]; then
+ # Download the Minio S3 server into PATH
+ if [ $TRAVIS_OS_NAME = "osx" ]; then
+ MINIO_URL=https://dl.min.io/server/minio/release/darwin-amd64/minio
+ else
+ MINIO_URL=https://dl.min.io/server/minio/release/linux-amd64/minio
+ fi
+
+ S3FS_DIR=~/.local/bin/
+ mkdir -p $S3FS_DIR
+ wget --directory-prefix $S3FS_DIR $MINIO_URL
+ chmod +x $S3FS_DIR/minio
+fi
\ No newline at end of file
diff --git a/ci/travis_install_osx.sh b/ci/travis_install_osx.sh
index 38e971710d..2d79eb017e 100755
--- a/ci/travis_install_osx.sh
+++ b/ci/travis_install_osx.sh
@@ -40,4 +40,4 @@ if [ "$ARROW_CI_RUBY_AFFECTED" = "1" ]; then
run_brew bundle --file=$TRAVIS_BUILD_DIR/cpp/Brewfile --verbose
run_brew bundle --file=$TRAVIS_BUILD_DIR/c_glib/Brewfile --verbose
rm ${brew_log_path}
-fi
+fi
\ No newline at end of file
diff --git a/ci/travis_script_python.sh b/ci/travis_script_python.sh
index 6b095b878e..8b3066f6e7 100755
--- a/ci/travis_script_python.sh
+++ b/ci/travis_script_python.sh
@@ -100,6 +100,10 @@ CMAKE_COMMON_FLAGS="-DARROW_EXTRA_ERROR_CONTEXT=ON"
PYTHON_CPP_BUILD_TARGETS="arrow_python-all plasma parquet"
+if [ "$ARROW_TRAVIS_S3" == "1" ]; then
+ CMAKE_COMMON_FLAGS="$CMAKE_COMMON_FLAGS -DARROW_S3=ON"
+fi
+
if [ "$ARROW_TRAVIS_FLIGHT" == "1" ]; then
CMAKE_COMMON_FLAGS="$CMAKE_COMMON_FLAGS -DARROW_FLIGHT=ON"
fi
@@ -164,6 +168,9 @@ export PYARROW_BUILD_TYPE=$ARROW_BUILD_TYPE
export PYARROW_WITH_PARQUET=1
export PYARROW_WITH_PLASMA=1
export PYARROW_WITH_ORC=1
+if [ "$ARROW_TRAVIS_S3" == "1" ]; then
+ export PYARROW_WITH_S3=1
+fi
if [ "$ARROW_TRAVIS_FLIGHT" == "1" ]; then
export PYARROW_WITH_FLIGHT=1
fi
@@ -177,6 +184,7 @@ python setup.py develop
python -c "import pyarrow.parquet"
python -c "import pyarrow.plasma"
python -c "import pyarrow.orc"
+python -c "import pyarrow.fs"
# Ensure we do eagerly import pandas (or other expensive imports)
python < scripts/test_imports.py