Skip to content

Commit

Permalink
ARROW-55: [Python] Fix unit tests in 2.7
Browse files Browse the repository at this point in the history
Fixing the #define check for Python 2 makes all unit tests pass in Python 2.7.

Author: Dan Robinson <danrobinson010@gmail.com>

Closes #25 from danrobinson/ARROW-55 and squashes the following commits:

dda4396 [Dan Robinson] ARROW-55: Add Python 2.7 tests to travis-ci
b00524b [Dan Robinson] ARROW-55: [Python] Fix unit tests in 2.7
  • Loading branch information
danrobinson authored and wesm committed Mar 16, 2016
1 parent 6fdcd49 commit 883c62b
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 16 deletions.
35 changes: 20 additions & 15 deletions ci/travis_script_python.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,29 +26,34 @@ export PATH="$MINICONDA/bin:$PATH"
conda update -y -q conda
conda info -a

PYTHON_VERSION=3.5
CONDA_ENV_NAME=pyarrow-test
python_version_tests() {
PYTHON_VERSION=$1
CONDA_ENV_NAME="pyarrow-test-${PYTHON_VERSION}"
conda create -y -q -n $CONDA_ENV_NAME python=$PYTHON_VERSION
source activate $CONDA_ENV_NAME

conda create -y -q -n $CONDA_ENV_NAME python=$PYTHON_VERSION
source activate $CONDA_ENV_NAME
python --version
which python

python --version
which python
# faster builds, please
conda install -y nomkl

# faster builds, please
conda install -y nomkl
# Expensive dependencies install from Continuum package repo
conda install -y pip numpy pandas cython

# Expensive dependencies install from Continuum package repo
conda install -y pip numpy pandas cython
# Other stuff pip install
pip install -r requirements.txt

# Other stuff pip install
pip install -r requirements.txt
export ARROW_HOME=$ARROW_CPP_INSTALL

export ARROW_HOME=$ARROW_CPP_INSTALL
python setup.py build_ext --inplace

python setup.py build_ext --inplace
py.test -vv -r sxX pyarrow
}

py.test -vv -r sxX pyarrow
# run tests for python 2.7 and 3.5
python_version_tests 2.7
python_version_tests 3.5

# if [ $TRAVIS_OS_NAME == "linux" ]; then
# valgrind --tool=memcheck py.test -vv -r sxX arrow
Expand Down
2 changes: 1 addition & 1 deletion python/src/pyarrow/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ namespace arrow { class MemoryPool; }

namespace pyarrow {

#define PYARROW_IS_PY2 PY_MAJOR_VERSION < 2
#define PYARROW_IS_PY2 PY_MAJOR_VERSION <= 2

#define RETURN_ARROW_NOT_OK(s) do { \
arrow::Status _s = (s); \
Expand Down

0 comments on commit 883c62b

Please sign in to comment.