Skip to content

Commit 73033f8

Browse files
authored
Backport PR #52211 on branch 2.0.x (CI: Test pyarrow nightly instead of intermediate versions) (#52313)
Backport PR #52211: CI: Test pyarrow nightly instead of intermediate versions
1 parent ced62f1 commit 73033f8

15 files changed

+49
-41
lines changed

.github/actions/setup-conda/action.yml

-11
Original file line numberDiff line numberDiff line change
@@ -9,20 +9,9 @@ inputs:
99
extra-specs:
1010
description: Extra packages to install
1111
required: false
12-
pyarrow-version:
13-
description: If set, overrides the PyArrow version in the Conda environment to the given string.
14-
required: false
1512
runs:
1613
using: composite
1714
steps:
18-
- name: Set Arrow version in ${{ inputs.environment-file }} to ${{ inputs.pyarrow-version }}
19-
run: |
20-
grep -q ' - pyarrow' ${{ inputs.environment-file }}
21-
sed -i"" -e "s/ - pyarrow/ - pyarrow=${{ inputs.pyarrow-version }}/" ${{ inputs.environment-file }}
22-
cat ${{ inputs.environment-file }}
23-
shell: bash
24-
if: ${{ inputs.pyarrow-version }}
25-
2615
- name: Install ${{ inputs.environment-file }}
2716
uses: mamba-org/provision-with-micromamba@v12
2817
with:

.github/workflows/macos-windows.yml

-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ jobs:
5151
uses: ./.github/actions/setup-conda
5252
with:
5353
environment-file: ci/deps/${{ matrix.env_file }}
54-
pyarrow-version: ${{ matrix.os == 'macos-latest' && '9' || '' }}
5554

5655
- name: Build Pandas
5756
uses: ./.github/actions/build_pandas

.github/workflows/ubuntu.yml

+5-17
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ jobs:
2727
env_file: [actions-38.yaml, actions-39.yaml, actions-310.yaml, actions-311.yaml]
2828
# Prevent the include jobs from overriding other jobs
2929
pattern: [""]
30-
pyarrow_version: ["8", "9", "10"]
3130
include:
3231
- name: "Downstream Compat"
3332
env_file: actions-38-downstream_compat.yaml
@@ -75,21 +74,11 @@ jobs:
7574
# TODO(cython3): Re-enable once next-beta(after beta 1) comes out
7675
# There are some warnings failing the build with -werror
7776
pandas_ci: "0"
78-
exclude:
79-
- env_file: actions-38.yaml
80-
pyarrow_version: "8"
81-
- env_file: actions-38.yaml
82-
pyarrow_version: "9"
83-
- env_file: actions-39.yaml
84-
pyarrow_version: "8"
85-
- env_file: actions-39.yaml
86-
pyarrow_version: "9"
87-
- env_file: actions-310.yaml
88-
pyarrow_version: "8"
89-
- env_file: actions-310.yaml
90-
pyarrow_version: "9"
77+
- name: "Pyarrow Nightly"
78+
env_file: actions-311-pyarrownightly.yaml
79+
pattern: "not slow and not network and not single_cpu"
9180
fail-fast: false
92-
name: ${{ matrix.name || format('{0} pyarrow={1} {2}', matrix.env_file, matrix.pyarrow_version, matrix.pattern) }}
81+
name: ${{ matrix.name || matrix.env_file }}
9382
env:
9483
ENV_FILE: ci/deps/${{ matrix.env_file }}
9584
PATTERN: ${{ matrix.pattern }}
@@ -107,7 +96,7 @@ jobs:
10796
COVERAGE: ${{ !contains(matrix.env_file, 'pypy') }}
10897
concurrency:
10998
# https://github.community/t/concurrecy-not-work-for-push/183068/7
110-
group: ${{ github.event_name == 'push' && github.run_number || github.ref }}-${{ matrix.env_file }}-${{ matrix.pattern }}-${{ matrix.pyarrow_version || '' }}-${{ matrix.extra_apt || '' }}-${{ matrix.pandas_data_manager || '' }}
99+
group: ${{ github.event_name == 'push' && github.run_number || github.ref }}-${{ matrix.env_file }}-${{ matrix.pattern }}-${{ matrix.extra_apt || '' }}-${{ matrix.pandas_data_manager || '' }}
111100
cancel-in-progress: true
112101

113102
services:
@@ -166,7 +155,6 @@ jobs:
166155
uses: ./.github/actions/setup-conda
167156
with:
168157
environment-file: ${{ env.ENV_FILE }}
169-
pyarrow-version: ${{ matrix.pyarrow_version }}
170158

171159
- name: Build Pandas
172160
id: build

ci/deps/actions-310.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ dependencies:
4141
- psycopg2
4242
- pymysql
4343
- pytables
44-
- pyarrow
44+
- pyarrow>=7.0.0
4545
- pyreadstat
4646
- python-snappy
4747
- pyxlsb
+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: pandas-dev
2+
channels:
3+
- conda-forge
4+
dependencies:
5+
- python=3.11
6+
7+
# build dependencies
8+
- versioneer[toml]
9+
- cython>=0.29.33
10+
11+
# test dependencies
12+
- pytest>=7.0.0
13+
- pytest-cov
14+
- pytest-xdist>=2.2.0
15+
- hypothesis>=6.34.2
16+
- pytest-asyncio>=0.17.0
17+
18+
# required dependencies
19+
- python-dateutil
20+
- numpy
21+
- pytz
22+
- pip
23+
24+
- pip:
25+
- "tzdata>=2022.1"
26+
- "--extra-index-url https://pypi.fury.io/arrow-nightlies/"
27+
- "--prefer-binary"
28+
- "--pre"
29+
- "pyarrow"

ci/deps/actions-311.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ dependencies:
4141
- psycopg2
4242
- pymysql
4343
# - pytables>=3.8.0 # first version that supports 3.11
44-
- pyarrow
44+
- pyarrow>=7.0.0
4545
- pyreadstat
4646
- python-snappy
4747
- pyxlsb

ci/deps/actions-38-downstream_compat.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ dependencies:
3939
- openpyxl<3.1.1
4040
- odfpy
4141
- psycopg2
42-
- pyarrow
42+
- pyarrow>=7.0.0
4343
- pymysql
4444
- pyreadstat
4545
- pytables

ci/deps/actions-38.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ dependencies:
3939
- odfpy
4040
- pandas-gbq
4141
- psycopg2
42-
- pyarrow
42+
- pyarrow>=7.0.0
4343
- pymysql
4444
- pyreadstat
4545
- pytables

ci/deps/actions-39.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ dependencies:
4040
- pandas-gbq
4141
- psycopg2
4242
- pymysql
43-
- pyarrow
43+
- pyarrow>=7.0.0
4444
- pyreadstat
4545
- pytables
4646
- python-snappy

ci/deps/circle-38-arm64.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ dependencies:
3939
- odfpy
4040
- pandas-gbq
4141
- psycopg2
42-
- pyarrow
42+
- pyarrow>=7.0.0
4343
- pymysql
4444
# Not provided on ARM
4545
#- pyreadstat

environment.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ dependencies:
4242
- odfpy
4343
- py
4444
- psycopg2
45-
- pyarrow
45+
- pyarrow>=7.0.0
4646
- pymysql
4747
- pyreadstat
4848
- pytables

pandas/tests/arrays/string_/test_string.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
import pandas as pd
1313
import pandas._testing as tm
1414
from pandas.core.arrays.string_arrow import ArrowStringArray
15+
from pandas.util.version import Version
1516

1617

1718
@pytest.fixture
@@ -406,15 +407,14 @@ def test_fillna_args(dtype, request):
406407
arr.fillna(value=1)
407408

408409

409-
@td.skip_if_no("pyarrow")
410410
def test_arrow_array(dtype):
411411
# protocol added in 0.15.0
412-
import pyarrow as pa
412+
pa = pytest.importorskip("pyarrow")
413413

414414
data = pd.array(["a", "b", "c"], dtype=dtype)
415415
arr = pa.array(data)
416416
expected = pa.array(list(data), type=pa.string(), from_pandas=True)
417-
if dtype.storage == "pyarrow":
417+
if dtype.storage == "pyarrow" and Version(pa.__version__) <= Version("11.0.0"):
418418
expected = pa.chunked_array(expected)
419419

420420
assert arr.equals(expected)

pandas/tests/io/test_parquet.py

+3
Original file line numberDiff line numberDiff line change
@@ -1019,7 +1019,10 @@ def test_read_dtype_backend_pyarrow_config_index(self, pa):
10191019
{"a": [1, 2]}, index=pd.Index([3, 4], name="test"), dtype="int64[pyarrow]"
10201020
)
10211021
expected = df.copy()
1022+
import pyarrow
10221023

1024+
if Version(pyarrow.__version__) > Version("11.0.0"):
1025+
expected.index = expected.index.astype("int64[pyarrow]")
10231026
check_round_trip(
10241027
df,
10251028
engine=pa,

pandas/tests/util/test_show_versions.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ def test_show_versions_console(capsys):
6565
assert re.search(r"numpy\s*:\s[0-9]+\..*\n", result)
6666

6767
# check optional dependency
68-
assert re.search(r"pyarrow\s*:\s([0-9\.]+|None)\n", result)
68+
assert re.search(r"pyarrow\s*:\s([0-9]+.*|None)\n", result)
6969

7070

7171
def test_json_output_match(capsys, tmpdir):

requirements-dev.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ openpyxl<3.1.1
3131
odfpy
3232
py
3333
psycopg2-binary
34-
pyarrow
34+
pyarrow>=7.0.0
3535
pymysql
3636
pyreadstat
3737
tables

0 commit comments

Comments
 (0)