Skip to content

Commit

Permalink
ARROW-7936: [Python] Fix and exercise tests on python 3.5
Browse files Browse the repository at this point in the history
- added bindings for the Codec class
- support to check compiled/available compression types
- test on ubuntu 16.04 with python 3.5.2 (needs to pin dependencies because of python typing incompatibilities)
- skip the failing Filesystem.from_uri tests on python 3.5 because pathlib.Path.resolve checks that the path exists (which is not)
- run a github actions build with python 3.5.2 test for each commit

Closes #6503 from kszucs/py35 and squashes the following commits:

a5460d2 <Krisztián Szűcs> Docstrings and tests
629e03b <Krisztián Szűcs> trigger ci
94af5a0 <Krisztián Szűcs> OrderedDict
2c85212 <Krisztián Szűcs> fix workflow syntax
649c0b5 <Krisztián Szűcs> ARROW-7936:  Fix and exercise tests on python 3.5

Authored-by: Krisztián Szűcs <szucs.krisztian@gmail.com>
Signed-off-by: Krisztián Szűcs <szucs.krisztian@gmail.com>
  • Loading branch information
kszucs committed Mar 2, 2020
1 parent 357eb6b commit 8200626
Show file tree
Hide file tree
Showing 12 changed files with 366 additions and 193 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/python.yml
Expand Up @@ -34,11 +34,15 @@ on:
jobs:

ubuntu:
name: AMD64 Ubuntu 18.04 Python 3
name: AMD64 Ubuntu ${{ matrix.ubuntu }} Python 3
runs-on: ubuntu-latest
if: github.event_name == 'push'
strategy:
fail-fast: false
matrix:
ubuntu: [16.04, 18.04]
env:
UBUNTU: 18.04
UBUNTU: ${{ matrix.ubuntu }}
steps:
- name: Checkout Arrow
uses: actions/checkout@v1
Expand Down
6 changes: 3 additions & 3 deletions ci/docker/ubuntu-16.04-cpp.dockerfile
Expand Up @@ -44,7 +44,6 @@ RUN apt-get update -y -q && \
libgoogle-glog-dev \
liblz4-dev \
libre2-dev \
libsnappy-dev \
libssl-dev \
llvm-7-dev \
make \
Expand All @@ -65,8 +64,8 @@ RUN apt-get update -y -q && \
# unit tests, so doing vendored build by default
ENV ARROW_BUILD_BENCHMARKS=OFF \
ARROW_BUILD_TESTS=ON \
ARROW_DEPENDENCY_SOURCE=SYSTEM \
ARROW_DATASET=ON \
ARROW_DEPENDENCY_SOURCE=SYSTEM \
ARROW_GANDIVA_JAVA=OFF \
ARROW_GANDIVA=ON \
ARROW_HOME=/usr/local \
Expand All @@ -85,9 +84,10 @@ ENV ARROW_BUILD_BENCHMARKS=OFF \
gRPC_SOURCE=BUNDLED \
GTest_SOURCE=BUNDLED \
ORC_SOURCE=BUNDLED \
PARQUET_BUILD_EXECUTABLES=ON \
PARQUET_BUILD_EXAMPLES=ON \
PARQUET_BUILD_EXECUTABLES=ON \
PATH=/usr/lib/ccache/:$PATH \
Protobuf_SOURCE=BUNDLED \
RapidJSON_SOURCE=BUNDLED \
Snappy_SOURCE=BUNDLED \
Thrift_SOURCE=BUNDLED
1 change: 1 addition & 0 deletions ci/scripts/cpp_build.sh
Expand Up @@ -120,6 +120,7 @@ cmake -G "${CMAKE_GENERATOR:-Ninja}" \
-DProtobuf_SOURCE=${Protobuf_SOURCE:-AUTO} \
-DRapidJSON_SOURCE=${RapidJSON_SOURCE:-AUTO} \
-DRE2_SOURCE=${RE2_SOURCE:-AUTO} \
-DSnappy_SOURCE=${Snappy_SOURCE:-AUTO} \
-DThrift_SOURCE=${Thrift_SOURCE:-AUTO} \
-DZSTD_SOURCE=${ZSTD_SOURCE:-AUTO} \
${CMAKE_ARGS} \
Expand Down
1 change: 0 additions & 1 deletion dev/tasks/python-wheels/osx-build.sh
Expand Up @@ -58,7 +58,6 @@ function build_wheel {
pushd cpp
mkdir build
pushd build

cmake -DARROW_BUILD_SHARED=ON \
-DARROW_BUILD_TESTS=OFF \
-DARROW_DATASET=ON \
Expand Down
2 changes: 1 addition & 1 deletion python/pyarrow/__init__.py
Expand Up @@ -105,7 +105,7 @@ def parse_git(root, **kwargs):

# Buffers, allocation
from pyarrow.lib import (Buffer, ResizableBuffer, foreign_buffer, py_buffer,
compress, decompress, allocate_buffer)
Codec, compress, decompress, allocate_buffer)

from pyarrow.lib import (MemoryPool, LoggingMemoryPool, ProxyMemoryPool,
total_allocated_bytes, set_memory_pool,
Expand Down
24 changes: 13 additions & 11 deletions python/pyarrow/includes/libarrow.pxd
Expand Up @@ -1694,27 +1694,29 @@ cdef extern from 'arrow/python/benchmark.h' namespace 'arrow::py::benchmark':


cdef extern from 'arrow/util/compression.h' namespace 'arrow' nogil:
enum CompressionType" arrow::Compression::type":
CompressionType_UNCOMPRESSED" arrow::Compression::UNCOMPRESSED"
CompressionType_SNAPPY" arrow::Compression::SNAPPY"
CompressionType_GZIP" arrow::Compression::GZIP"
CompressionType_BROTLI" arrow::Compression::BROTLI"
CompressionType_ZSTD" arrow::Compression::ZSTD"
CompressionType_LZ4" arrow::Compression::LZ4"
CompressionType_BZ2" arrow::Compression::BZ2"
enum CCompressionType" arrow::Compression::type":
CCompressionType_UNCOMPRESSED" arrow::Compression::UNCOMPRESSED"
CCompressionType_SNAPPY" arrow::Compression::SNAPPY"
CCompressionType_GZIP" arrow::Compression::GZIP"
CCompressionType_BROTLI" arrow::Compression::BROTLI"
CCompressionType_ZSTD" arrow::Compression::ZSTD"
CCompressionType_LZ4" arrow::Compression::LZ4"
CCompressionType_BZ2" arrow::Compression::BZ2"

cdef cppclass CCodec" arrow::util::Codec":
@staticmethod
CResult[unique_ptr[CCodec]] Create(CompressionType codec)
CResult[unique_ptr[CCodec]] Create(CCompressionType codec)

@staticmethod
c_bool IsAvailable(CCompressionType codec)

CResult[int64_t] Decompress(int64_t input_len, const uint8_t* input,
int64_t output_len,
uint8_t* output_buffer)

CResult[int64_t] Compress(int64_t input_len, const uint8_t* input,
int64_t output_buffer_len,
uint8_t* output_buffer)

const char* name() const
int64_t MaxCompressedLen(int64_t input_len, const uint8_t* input)


Expand Down

0 comments on commit 8200626

Please sign in to comment.