From c1bdc3c61e76a0e5f007a9892453fb7ded0cff7b Mon Sep 17 00:00:00 2001 From: Tadeja Kadunc Date: Sun, 25 Jan 2026 13:29:34 +0100 Subject: [PATCH 1/5] Attempt to upgrade pandas to latest --- ci/scripts/install_pandas.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/scripts/install_pandas.sh b/ci/scripts/install_pandas.sh index 03009b3824f..b8a63632e28 100755 --- a/ci/scripts/install_pandas.sh +++ b/ci/scripts/install_pandas.sh @@ -40,7 +40,7 @@ if [ "${pandas}" = "upstream_devel" ]; then elif [ "${pandas}" = "nightly" ]; then pip install --extra-index-url https://pypi.anaconda.org/scientific-python-nightly-wheels/simple --pre pandas elif [ "${pandas}" = "latest" ]; then - pip install pandas + pip install --upgrade pandas else pip install pandas=="${pandas}" fi From 84aa3433535d3b7e89ff74b950cda48607bac63d Mon Sep 17 00:00:00 2001 From: Tadeja Kadunc Date: Sun, 25 Jan 2026 15:27:41 +0100 Subject: [PATCH 2/5] Test with fastparquet and w/o pytz --- ci/scripts/install_pandas.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ci/scripts/install_pandas.sh b/ci/scripts/install_pandas.sh index b8a63632e28..d43132072e6 100755 --- a/ci/scripts/install_pandas.sh +++ b/ci/scripts/install_pandas.sh @@ -40,7 +40,8 @@ if [ "${pandas}" = "upstream_devel" ]; then elif [ "${pandas}" = "nightly" ]; then pip install --extra-index-url https://pypi.anaconda.org/scientific-python-nightly-wheels/simple --pre pandas elif [ "${pandas}" = "latest" ]; then - pip install --upgrade pandas + pip install --upgrade pandas fastparquet + pip uninstall pytz else pip install pandas=="${pandas}" fi From a5222a68a7f4c371d9811e7740e3a4387c2c1eb6 Mon Sep 17 00:00:00 2001 From: Tadeja Kadunc Date: Sun, 25 Jan 2026 15:38:21 +0100 Subject: [PATCH 3/5] Test with fastparquet and w/o pytz --- ci/scripts/install_pandas.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/scripts/install_pandas.sh b/ci/scripts/install_pandas.sh index d43132072e6..4a6f61f0884 100755 --- a/ci/scripts/install_pandas.sh +++ b/ci/scripts/install_pandas.sh @@ -41,7 +41,7 @@ elif [ "${pandas}" = "nightly" ]; then pip install --extra-index-url https://pypi.anaconda.org/scientific-python-nightly-wheels/simple --pre pandas elif [ "${pandas}" = "latest" ]; then pip install --upgrade pandas fastparquet - pip uninstall pytz + pip uninstall -q -y pytz else pip install pandas=="${pandas}" fi From 6f778a4aea15df7ea038ea7ab158a014d200f06c Mon Sep 17 00:00:00 2001 From: Tadeja Kadunc Date: Sun, 25 Jan 2026 19:11:07 +0100 Subject: [PATCH 4/5] Fix fromutc and fastparquet failures --- python/pyarrow/tests/parquet/test_basic.py | 12 ++++++++---- python/pyarrow/tests/test_pandas.py | 2 +- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/python/pyarrow/tests/parquet/test_basic.py b/python/pyarrow/tests/parquet/test_basic.py index 94868741f39..abcbd6ee597 100644 --- a/python/pyarrow/tests/parquet/test_basic.py +++ b/python/pyarrow/tests/parquet/test_basic.py @@ -751,17 +751,21 @@ def test_fastparquet_cross_compatibility(tempdir): fp_file = fp.ParquetFile(file_arrow) df_fp = fp_file.to_pandas() - tm.assert_frame_equal(df, df_fp) + # check_dtype=False: string/categorical dtype handling differs between libraries + tm.assert_frame_equal(df, df_fp, check_dtype=False, check_categorical=False) # Fastparquet -> arrow file_fastparquet = str(tempdir / "cross_compat_fastparquet.parquet") - fp.write(file_fastparquet, df) + # fastparquet can't write pandas 3.0 StringDtype + df_for_fp = df.copy() + df_for_fp['a'] = df_for_fp['a'].astype(object) + df_for_fp['f'] = df_for_fp['f'].astype(object) + fp.write(file_fastparquet, df_for_fp) table_fp = pq.read_pandas(file_fastparquet) # for fastparquet written file, categoricals comes back as strings # (no arrow schema in parquet metadata) - df['f'] = df['f'].astype(object) - tm.assert_frame_equal(table_fp.to_pandas(), df) + tm.assert_frame_equal(table_fp.to_pandas(), df_for_fp, check_dtype=False) @pytest.mark.parametrize('array_factory', [ diff --git a/python/pyarrow/tests/test_pandas.py b/python/pyarrow/tests/test_pandas.py index cecf10f2165..e7b625422f4 100644 --- a/python/pyarrow/tests/test_pandas.py +++ b/python/pyarrow/tests/test_pandas.py @@ -4956,7 +4956,7 @@ def test_timestamp_as_object_non_nanosecond(resolution, tz, dt): assert isinstance(result[0], datetime) if tz: assert result[0].tzinfo is not None - expected = result[0].tzinfo.fromutc(dt) + expected = dt.replace(tzinfo=timezone.utc).astimezone(result[0].tzinfo) else: assert result[0].tzinfo is None expected = dt From 1bce5ee170748f686356d0c7b96d20cac6038b86 Mon Sep 17 00:00:00 2001 From: Tadeja Kadunc Date: Sun, 25 Jan 2026 20:25:58 +0100 Subject: [PATCH 5/5] Revert to w/o fastparquet and with pytz --- ci/scripts/install_pandas.sh | 3 +-- python/pyarrow/tests/parquet/test_basic.py | 1 + 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ci/scripts/install_pandas.sh b/ci/scripts/install_pandas.sh index 4a6f61f0884..b8a63632e28 100755 --- a/ci/scripts/install_pandas.sh +++ b/ci/scripts/install_pandas.sh @@ -40,8 +40,7 @@ if [ "${pandas}" = "upstream_devel" ]; then elif [ "${pandas}" = "nightly" ]; then pip install --extra-index-url https://pypi.anaconda.org/scientific-python-nightly-wheels/simple --pre pandas elif [ "${pandas}" = "latest" ]; then - pip install --upgrade pandas fastparquet - pip uninstall -q -y pytz + pip install --upgrade pandas else pip install pandas=="${pandas}" fi diff --git a/python/pyarrow/tests/parquet/test_basic.py b/python/pyarrow/tests/parquet/test_basic.py index abcbd6ee597..e50b2715e3e 100644 --- a/python/pyarrow/tests/parquet/test_basic.py +++ b/python/pyarrow/tests/parquet/test_basic.py @@ -728,6 +728,7 @@ def test_parquet_file_too_small(tempdir): @pytest.mark.fastparquet @pytest.mark.filterwarnings("ignore:RangeIndex:FutureWarning") @pytest.mark.filterwarnings("ignore:tostring:DeprecationWarning:fastparquet") +@pytest.mark.filterwarnings("ignore:unclosed file:ResourceWarning") def test_fastparquet_cross_compatibility(tempdir): fp = pytest.importorskip('fastparquet')