diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 30894f80..9ce90e13 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,23 +14,27 @@ jobs: matrix: PYTHON_VERSION: ['3.6', '3.7', '3.8'] PYARROW_VERSION: ['latest'] + PANDAS_VERSION: ['latest'] UPSTREAM_DEV: ['default'] include: - UPSTREAM_DEV: 'default' PYARROW_VERSION: '0.17.1' + PANDAS_VERSION: '1.1' PYTHON_VERSION: '3.8' - UPSTREAM_DEV: 'default' PYARROW_VERSION: '1.0.1' + PANDAS_VERSION: 'latest' PYTHON_VERSION: '3.8' - UPSTREAM_DEV: 'nightlies' PYARROW_VERSION: 'latest' + PANDAS_VERSION: 'latest' PYTHON_VERSION: '3.8' steps: - name: Checkout branch uses: actions/checkout@v1.2.0 - name: Run CI shell: bash -l {0} - run: ./ci/circle_build_linux.sh ${{ matrix.PYTHON_VERSION }} ${{ matrix.PYARROW_VERSION }} ${{ matrix.UPSTREAM_DEV }} + run: ./ci/circle_build_linux.sh ${{ matrix.PYTHON_VERSION }} ${{ matrix.PYARROW_VERSION }} ${{ matrix.PANDAS_VERSION }} ${{ matrix.UPSTREAM_DEV }} - name: Publish package if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') && matrix.PYTHON_VERSION == '3.7' uses: pypa/gh-action-pypi-publish@v1.3.1 diff --git a/.github/workflows/cron.yml b/.github/workflows/cron.yml index 5d94343d..ea7a1a98 100644 --- a/.github/workflows/cron.yml +++ b/.github/workflows/cron.yml @@ -17,6 +17,7 @@ jobs: matrix: PYTHON_VERSION: ['3.6'] PYARROW_VERSION: ['latest'] + PANDAS_VERSION: ['latest'] UPSTREAM_DEV: ['default'] include: - UPSTREAM_DEV: 'nightlies' @@ -27,7 +28,7 @@ jobs: uses: actions/checkout@v1.2.0 - name: Run CI shell: bash -l {0} - run: ./ci/circle_build_linux.sh ${{ matrix.PYTHON_VERSION }} ${{ matrix.PYARROW_VERSION }} ${{ matrix.UPSTREAM_DEV }} + run: ./ci/circle_build_linux.sh ${{ matrix.PYTHON_VERSION }} ${{ matrix.PYARROW_VERSION }} ${{ matrix.PANDAS_VERSION }} ${{ matrix.UPSTREAM_DEV }} - uses: codecov/codecov-action@v1 with: token: ${{ secrets.CODECOV_TOKEN }} diff --git a/CHANGELOG.md b/CHANGELOG.md index af62237f..adf531ea 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,11 @@ Starting with 0.5, we will follow the following versioning scheme: * We bump MINOR on breaking changes. * We increase PATCH otherwise. +0.7.1 (2020-12-29) +------------------ + +* Fix return values for `str` functions with `pandas=1.2` and `pyarrow=1`. +* Ensure that parallel variants of `apply_binary_str` actually parallize. 0.7.0 (2020-12-07) ------------------ diff --git a/ci/circle_build_linux.sh b/ci/circle_build_linux.sh index d95bd718..4254e9e0 100755 --- a/ci/circle_build_linux.sh +++ b/ci/circle_build_linux.sh @@ -7,7 +7,8 @@ export LC_ALL=C.UTF-8 export LANG=C.UTF-8 export PYTHON_VERSION=$1 export PYARROW_VERSION=$2 -export USE_DEV_WHEELS=$3 +export PANDAS_VERSION=$3 +export USE_DEV_WHEELS=$4 export CONDA_PKGS_DIRS=$HOME/.conda_packages export MINICONDA=$HOME/miniconda export MINICONDA_URL="https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh" @@ -17,6 +18,8 @@ wget --no-verbose -O miniconda.sh $MINICONDA_URL bash miniconda.sh -b -p $MINICONDA export PATH="$MINICONDA/bin:$PATH" +set -x + conda config --set auto_update_conda false conda config --add channels conda-forge conda install -y mamba yq jq @@ -30,10 +33,15 @@ fi if [ "${PYARROW_VERSION}" = "latest" ]; then yq -Y ". + {channels: [${CONDA_CHANNELS}], dependencies: [.dependencies[], \"python=${PYTHON_VERSION}\"] }" environment.yml > /tmp/environment.yml else - yq -Y ". + {channels: [${CONDA_CHANNELS}], dependencies: [.dependencies[], \"python=${PYTHON_VERSION}\", \"pyarrow=${PYARROW_VERSION}\"] }" environment.yml > /tmp/environment.yml + if [ "${PANDAS_VERSION}" = "latest" ]; then + yq -Y ". + {channels: [${CONDA_CHANNELS}], dependencies: [.dependencies[], \"python=${PYTHON_VERSION}\", \"pyarrow=${PYARROW_VERSION}\"] }" environment.yml > /tmp/environment.yml + else + yq -Y ". + {channels: [${CONDA_CHANNELS}], dependencies: [.dependencies[], \"python=${PYTHON_VERSION}\", \"pyarrow=${PYARROW_VERSION}\", \"pandas=${PANDAS_VERSION}\"] }" environment.yml > /tmp/environment.yml + fi fi cat /tmp/environment.yml mamba env create -f /tmp/environment.yml +set +x source activate fletcher if [ "${PYTHON_VERSION}" = "3.7" ]; then diff --git a/fletcher/algorithms/string.py b/fletcher/algorithms/string.py index cf0b111b..0ac9a32b 100644 --- a/fletcher/algorithms/string.py +++ b/fletcher/algorithms/string.py @@ -954,7 +954,7 @@ def _apply_with_nulls( ) -@njit +@njit(parallel=True) def _apply_no_nulls_parallel( func: Callable, length: int, @@ -973,7 +973,7 @@ def _apply_no_nulls_parallel( ) -@njit +@njit(parallel=True) def _apply_with_nulls_parallel( func: Callable, length: int, diff --git a/fletcher/string_mixin.py b/fletcher/string_mixin.py index 743d7e62..ca421f6f 100644 --- a/fletcher/string_mixin.py +++ b/fletcher/string_mixin.py @@ -39,49 +39,49 @@ def _str_isalnum(self): if hasattr(pc, "utf8_is_alnum"): return type(self)(pc.utf8_is_alnum(self.data)) else: - super()._str_isalnum() + return super()._str_isalnum() def _str_isalpha(self): if hasattr(pc, "utf8_is_alpha"): return type(self)(pc.utf8_is_alpha(self.data)) else: - super()._str_isalpha() + return super()._str_isalpha() def _str_isdecimal(self): if hasattr(pc, "utf8_is_decimal"): return type(self)(pc.utf8_is_decimal(self.data)) else: - super()._str_isdecimal() + return super()._str_isdecimal() def _str_isdigit(self): if hasattr(pc, "utf8_is_digit"): return type(self)(pc.utf8_is_digit(self.data)) else: - super()._str_isdigit() + return super()._str_isdigit() def _str_islower(self): if hasattr(pc, "utf8_is_lower"): return type(self)(pc.utf8_is_lower(self.data)) else: - super()._str_islower() + return super()._str_islower() def _str_isnumeric(self): if hasattr(pc, "utf8_is_numeric"): return type(self)(pc.utf8_is_numeric(self.data)) else: - super()._str_isnumeric() + return super()._str_isnumeric() def _str_isspace(self): if hasattr(pc, "utf8_is_space"): return type(self)(pc.utf8_is_space(self.data)) else: - super()._str_isspace() + return super()._str_isspace() def _str_istitle(self): if hasattr(pc, "utf8_is_title"): return type(self)(pc.utf8_is_title(self.data)) else: - super()._str_istitle() + return super()._str_istitle() def _str_isupper(self): if hasattr(pc, "utf8_is_upper"): diff --git a/tests/test_pandas_extension.py b/tests/test_pandas_extension.py index 6283d61e..1c82e774 100644 --- a/tests/test_pandas_extension.py +++ b/tests/test_pandas_extension.py @@ -640,7 +640,13 @@ def test_setitem_sequence(self, data, box_in_series): @xfail_list_setitem_not_implemented def test_setitem_empty_indxer(self, data, box_in_series): - BaseSetitemTests.test_setitem_empty_indxer(self, data, box_in_series) + if hasattr(BaseSetitemTests, "test_setitem_empty_indxer"): + BaseSetitemTests.test_setitem_empty_indxer(self, data, box_in_series) + + @xfail_list_setitem_not_implemented + def test_setitem_empty_indexer(self, data, box_in_series): + if hasattr(BaseSetitemTests, "test_setitem_empty_indexer"): + BaseSetitemTests.test_setitem_empty_indexer(self, data, box_in_series) @xfail_list_setitem_not_implemented def test_setitem_sequence_broadcasts(self, data, box_in_series):