Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ARROW-6655: [Python] Filesystem bindings for S3
- Add support for S3FileSystem in the python bindings. - Fixed issue with reading all the content of an S3 object - Introduce `minio_server` fixture for parametrized testing of all filesystem implementations - Fixed s3fs parquet test and updated it to use minio_server fixture Closes #5423 from kszucs/s3 and squashes the following commits: 384c960 <Krisztián Szűcs> Resolve review comments 73e6625 <Krisztián Szűcs> S3Options 98bd91a <Krisztián Szűcs> remove commented tests db89859 <Krisztián Szűcs> rename to s3fs 4478458 <Krisztián Szűcs> fix read() issue c1df10b <Krisztián Szűcs> initialization in first use 192ab65 <Krisztián Szűcs> flake8 f70f9fb <Krisztián Szűcs> remove minio-client dependency d399643 <Krisztián Szűcs> simplify test suite fee57a9 <Krisztián Szűcs> remove accidentally committed files 751cfd4 <Krisztián Szűcs> resolve a couple of review comments; enum workaround 45436f7 <Krisztián Szűcs> cython flake8 38dcb88 <Krisztián Szűcs> rat c541b3e <Krisztián Szűcs> comment left 098048a <Krisztián Szűcs> more compat 00340ed <Krisztián Szűcs> fixture error handling 2be25ce <Krisztián Szűcs> auto initialize s3 on import 88e0c9f <Krisztián Szűcs> py2 compat 8585a60 <Krisztián Szűcs> py2 compat d372287 <Krisztián Szűcs> install minio in the conda-toolchain build 041cad4 <Krisztián Szűcs> executable flag fb0f281 <Krisztián Szűcs> travis minio install script 8cbe0ee <Krisztián Szűcs> travis osx 72e56a6 <Krisztián Szűcs> enable S3 in travis python builds 7800c75 <Krisztián Szűcs> appveyor flag 7daf566 <Krisztián Szűcs> fix syntax error in travis script 68eb591 <Krisztián Szűcs> enable PYARROW_WITH_S3 on appveyor 2cb19d1 <Krisztián Szűcs> conditional import of test dependencies efa05d2 <Krisztián Szűcs> use minio for dask.s3fs test too f25ae5a <Krisztián Szűcs> travis 9042c7e <Krisztián Szűcs> use S3FS_DIR 9ce7180 <Krisztián Szűcs> cmake format; fix orc cimport 45a2a17 <Krisztián Szűcs> docstrings c0b9162 <Krisztián Szűcs> test requirements; flake8 44aedfd <Krisztián Szűcs> stat test a343950 <Krisztián Szűcs> testing suite 1551b52 <Krisztián Szűcs> wip dd41d21 <Krisztián Szűcs> imports 5200af1 <Krisztián Szűcs> s3 filesystem bindings Authored-by: Krisztián Szűcs <szucs.krisztian@gmail.com> Signed-off-by: Antoine Pitrou <antoine@python.org>
- Loading branch information
Showing
40 changed files
with
1,054 additions
and
480 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,6 +22,7 @@ numpy>=1.14 | |
pandas | ||
pytest | ||
pytest-faulthandler | ||
pytest-lazy-fixture | ||
pytz | ||
setuptools | ||
setuptools_scm=3.2.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
# 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. | ||
|
||
# cython: language_level = 3 | ||
|
||
import six | ||
|
||
from pyarrow.compat import frombytes, tobytes | ||
from pyarrow.includes.common cimport * | ||
from pyarrow.includes.libarrow cimport PyDateTime_from_TimePoint | ||
from pyarrow.lib import _detect_compression | ||
from pyarrow.lib cimport * | ||
|
||
|
||
cpdef enum FileType: | ||
NonExistent = <int8_t> CFileType_NonExistent | ||
Unknown = <int8_t> CFileType_Unknown | ||
File = <int8_t> CFileType_File | ||
Directory = <int8_t> CFileType_Directory | ||
|
||
|
||
cdef class FileStats: | ||
cdef: | ||
CFileStats stats | ||
|
||
@staticmethod | ||
cdef FileStats wrap(CFileStats stats) | ||
|
||
|
||
cdef class Selector: | ||
cdef: | ||
CSelector selector | ||
|
||
|
||
cdef class FileSystem: | ||
cdef: | ||
shared_ptr[CFileSystem] wrapped | ||
CFileSystem* fs | ||
|
||
cdef init(self, const shared_ptr[CFileSystem]& wrapped) | ||
|
||
|
||
cdef class LocalFileSystem(FileSystem): | ||
cdef: | ||
CLocalFileSystem* localfs | ||
|
||
cdef init(self, const shared_ptr[CFileSystem]& wrapped) | ||
|
||
|
||
cdef class SubTreeFileSystem(FileSystem): | ||
cdef: | ||
CSubTreeFileSystem* subtreefs | ||
|
||
cdef init(self, const shared_ptr[CFileSystem]& wrapped) |
Oops, something went wrong.