From 3bbeea2c477e7c15849156b97f3aceba34c332fe Mon Sep 17 00:00:00 2001 From: GiTaDi-CrEaTe Date: Fri, 15 May 2026 15:20:05 +0530 Subject: [PATCH 01/25] TST: Add test for writing UUIDs to parquet with pyarrow #61602 --- pandas/tests/io/test_parquet.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/pandas/tests/io/test_parquet.py b/pandas/tests/io/test_parquet.py index f7eb9a21bb..983b379373 100644 --- a/pandas/tests/io/test_parquet.py +++ b/pandas/tests/io/test_parquet.py @@ -5,6 +5,7 @@ from io import BytesIO import os import pathlib +import uuid import numpy as np import pytest @@ -1521,3 +1522,20 @@ def test_invalid_dtype_backend(self, engine, temp_file): df.to_parquet(temp_file) with pytest.raises(ValueError, match=msg): read_parquet(temp_file, dtype_backend="numpy") + + +def test_to_parquet_uuid_supported(tmp_path): + # GH 61602 + pytest.importorskip("pyarrow", minversion="24.0.0") + + df = pd.DataFrame({"id": [uuid.uuid4(), uuid.uuid4()]}) + path = tmp_path / "test_uuid.parquet" + + # This should not raise an error + df.to_parquet(path, engine="pyarrow") + + # Verify it can be read back + result = pd.read_parquet(path, engine="pyarrow") + assert len(result) == 2 + + \ No newline at end of file From 88d4e28dda4c9b8c6e50203f38a684799e120557 Mon Sep 17 00:00:00 2001 From: GiTaDi-CrEaTe Date: Fri, 15 May 2026 15:34:23 +0530 Subject: [PATCH 02/25] TST: Fix read_parquet namespace usage --- pandas/tests/io/test_parquet.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandas/tests/io/test_parquet.py b/pandas/tests/io/test_parquet.py index 983b379373..5f264a5fb9 100644 --- a/pandas/tests/io/test_parquet.py +++ b/pandas/tests/io/test_parquet.py @@ -1535,7 +1535,7 @@ def test_to_parquet_uuid_supported(tmp_path): df.to_parquet(path, engine="pyarrow") # Verify it can be read back - result = pd.read_parquet(path, engine="pyarrow") + result = read_parquet(path, engine="pyarrow") assert len(result) == 2 \ No newline at end of file From 9d9815777c91bd56b3a9a8e898c4d83d25e40be1 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Fri, 15 May 2026 10:07:51 +0000 Subject: [PATCH 03/25] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- pandas/tests/io/test_parquet.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/pandas/tests/io/test_parquet.py b/pandas/tests/io/test_parquet.py index 5f264a5fb9..c11439e331 100644 --- a/pandas/tests/io/test_parquet.py +++ b/pandas/tests/io/test_parquet.py @@ -1527,15 +1527,13 @@ def test_invalid_dtype_backend(self, engine, temp_file): def test_to_parquet_uuid_supported(tmp_path): # GH 61602 pytest.importorskip("pyarrow", minversion="24.0.0") - + df = pd.DataFrame({"id": [uuid.uuid4(), uuid.uuid4()]}) path = tmp_path / "test_uuid.parquet" - + # This should not raise an error df.to_parquet(path, engine="pyarrow") - + # Verify it can be read back result = read_parquet(path, engine="pyarrow") - assert len(result) == 2 - - \ No newline at end of file + assert len(result) == 2 From 5f4d739815c11c24acb858e28274feccc75566a9 Mon Sep 17 00:00:00 2001 From: GiTaDi-CrEaTe Date: Fri, 15 May 2026 16:44:41 +0530 Subject: [PATCH 04/25] TST: Address reviewer feedback for UUID pyarrow test --- pandas/tests/io/test_parquet.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/pandas/tests/io/test_parquet.py b/pandas/tests/io/test_parquet.py index c11439e331..67bbb038f6 100644 --- a/pandas/tests/io/test_parquet.py +++ b/pandas/tests/io/test_parquet.py @@ -24,6 +24,7 @@ import pandas as pd import pandas._testing as tm +import pandas.util._test_decorators as td from pandas.util.version import Version from pandas.io.parquet import ( @@ -1524,10 +1525,14 @@ def test_invalid_dtype_backend(self, engine, temp_file): read_parquet(temp_file, dtype_backend="numpy") +@td.skip_if_no("pyarrow", min_version="24.0") def test_to_parquet_uuid_supported(tmp_path): # GH 61602 +<<<<<<< HEAD pytest.importorskip("pyarrow", minversion="24.0.0") +======= +>>>>>>> 3e900a418f (TST: Address reviewer feedback for UUID pyarrow test) df = pd.DataFrame({"id": [uuid.uuid4(), uuid.uuid4()]}) path = tmp_path / "test_uuid.parquet" @@ -1536,4 +1541,10 @@ def test_to_parquet_uuid_supported(tmp_path): # Verify it can be read back result = read_parquet(path, engine="pyarrow") +<<<<<<< HEAD assert len(result) == 2 +======= + tm.assert_frame_equal(result, df) + + +>>>>>>> 3e900a418f (TST: Address reviewer feedback for UUID pyarrow test) From 72dc35a90ed0b053066b502e727e75e9800b1513 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Fri, 15 May 2026 12:40:39 +0000 Subject: [PATCH 05/25] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- pandas/tests/io/test_parquet.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pandas/tests/io/test_parquet.py b/pandas/tests/io/test_parquet.py index 67bbb038f6..a16fb92f4b 100644 --- a/pandas/tests/io/test_parquet.py +++ b/pandas/tests/io/test_parquet.py @@ -21,10 +21,10 @@ pa_version_under20p0, ) from pandas.errors import Pandas4Warning +import pandas.util._test_decorators as td import pandas as pd import pandas._testing as tm -import pandas.util._test_decorators as td from pandas.util.version import Version from pandas.io.parquet import ( @@ -1544,7 +1544,7 @@ def test_to_parquet_uuid_supported(tmp_path): <<<<<<< HEAD assert len(result) == 2 ======= - tm.assert_frame_equal(result, df) - - + tm.assert_frame_equal(result, df) + + >>>>>>> 3e900a418f (TST: Address reviewer feedback for UUID pyarrow test) From c53e34c346ab6d879f0037b6999a6fa63995386d Mon Sep 17 00:00:00 2001 From: GiTaDi-CrEaTe Date: Fri, 15 May 2026 18:21:51 +0530 Subject: [PATCH 06/25] TST: Implement reviewer feedback and fix formatting --- pandas/tests/io/test_parquet.py | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/pandas/tests/io/test_parquet.py b/pandas/tests/io/test_parquet.py index a16fb92f4b..b3c9dced6c 100644 --- a/pandas/tests/io/test_parquet.py +++ b/pandas/tests/io/test_parquet.py @@ -1524,27 +1524,15 @@ def test_invalid_dtype_backend(self, engine, temp_file): with pytest.raises(ValueError, match=msg): read_parquet(temp_file, dtype_backend="numpy") - @td.skip_if_no("pyarrow", min_version="24.0") def test_to_parquet_uuid_supported(tmp_path): # GH 61602 -<<<<<<< HEAD - pytest.importorskip("pyarrow", minversion="24.0.0") - -======= ->>>>>>> 3e900a418f (TST: Address reviewer feedback for UUID pyarrow test) df = pd.DataFrame({"id": [uuid.uuid4(), uuid.uuid4()]}) path = tmp_path / "test_uuid.parquet" - + # This should not raise an error df.to_parquet(path, engine="pyarrow") - + # Verify it can be read back result = read_parquet(path, engine="pyarrow") -<<<<<<< HEAD - assert len(result) == 2 -======= tm.assert_frame_equal(result, df) - - ->>>>>>> 3e900a418f (TST: Address reviewer feedback for UUID pyarrow test) From 6b7b57f08d02104e3731a93e83d029015a20f4a2 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Fri, 15 May 2026 13:06:52 +0000 Subject: [PATCH 07/25] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- pandas/tests/io/test_parquet.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pandas/tests/io/test_parquet.py b/pandas/tests/io/test_parquet.py index b3c9dced6c..c3fd36819d 100644 --- a/pandas/tests/io/test_parquet.py +++ b/pandas/tests/io/test_parquet.py @@ -1524,15 +1524,16 @@ def test_invalid_dtype_backend(self, engine, temp_file): with pytest.raises(ValueError, match=msg): read_parquet(temp_file, dtype_backend="numpy") + @td.skip_if_no("pyarrow", min_version="24.0") def test_to_parquet_uuid_supported(tmp_path): # GH 61602 df = pd.DataFrame({"id": [uuid.uuid4(), uuid.uuid4()]}) path = tmp_path / "test_uuid.parquet" - + # This should not raise an error df.to_parquet(path, engine="pyarrow") - + # Verify it can be read back result = read_parquet(path, engine="pyarrow") tm.assert_frame_equal(result, df) From e699965458646374e6efe1989938513aee34d640 Mon Sep 17 00:00:00 2001 From: GiTaDi-CrEaTe Date: Sat, 16 May 2026 21:45:01 +0530 Subject: [PATCH 08/25] TST: Handle raw bytes fallback for UUIDs on PyArrow nightly/py314 --- pandas/tests/io/test_parquet.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pandas/tests/io/test_parquet.py b/pandas/tests/io/test_parquet.py index c3fd36819d..036dec884c 100644 --- a/pandas/tests/io/test_parquet.py +++ b/pandas/tests/io/test_parquet.py @@ -1536,4 +1536,11 @@ def test_to_parquet_uuid_supported(tmp_path): # Verify it can be read back result = read_parquet(path, engine="pyarrow") + + # PyArrow nightly / Python 3.14 currently returns raw bytes instead of UUID objects + # due to an upstream object-casting quirk. We handle the raw byte fallback gracefully + # to ensure the underlying 16-byte data integrity is preserved. + if len(result) > 0 and isinstance(result.loc[0, "id"], bytes): + result["id"] = result["id"].apply(lambda x: uuid.UUID(bytes=x)) + tm.assert_frame_equal(result, df) From 91f481c7be45defbd990037f40803871c45af503 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Sat, 16 May 2026 16:31:12 +0000 Subject: [PATCH 09/25] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- pandas/tests/io/test_parquet.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pandas/tests/io/test_parquet.py b/pandas/tests/io/test_parquet.py index 036dec884c..8f315e34bc 100644 --- a/pandas/tests/io/test_parquet.py +++ b/pandas/tests/io/test_parquet.py @@ -1536,11 +1536,11 @@ def test_to_parquet_uuid_supported(tmp_path): # Verify it can be read back result = read_parquet(path, engine="pyarrow") - + # PyArrow nightly / Python 3.14 currently returns raw bytes instead of UUID objects # due to an upstream object-casting quirk. We handle the raw byte fallback gracefully # to ensure the underlying 16-byte data integrity is preserved. if len(result) > 0 and isinstance(result.loc[0, "id"], bytes): result["id"] = result["id"].apply(lambda x: uuid.UUID(bytes=x)) - + tm.assert_frame_equal(result, df) From 6332052d7040e404c3464a803f22b7577a863b55 Mon Sep 17 00:00:00 2001 From: GiTaDi-CrEaTe Date: Sat, 16 May 2026 22:30:36 +0530 Subject: [PATCH 10/25] TST: Fix line length in comment to pass ruff --- pandas/tests/io/test_parquet.py | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/pandas/tests/io/test_parquet.py b/pandas/tests/io/test_parquet.py index 8f315e34bc..b478a63e82 100644 --- a/pandas/tests/io/test_parquet.py +++ b/pandas/tests/io/test_parquet.py @@ -1523,24 +1523,23 @@ def test_invalid_dtype_backend(self, engine, temp_file): df.to_parquet(temp_file) with pytest.raises(ValueError, match=msg): read_parquet(temp_file, dtype_backend="numpy") - - @td.skip_if_no("pyarrow", min_version="24.0") def test_to_parquet_uuid_supported(tmp_path): # GH 61602 df = pd.DataFrame({"id": [uuid.uuid4(), uuid.uuid4()]}) path = tmp_path / "test_uuid.parquet" - + # This should not raise an error df.to_parquet(path, engine="pyarrow") - + # Verify it can be read back result = read_parquet(path, engine="pyarrow") - - # PyArrow nightly / Python 3.14 currently returns raw bytes instead of UUID objects - # due to an upstream object-casting quirk. We handle the raw byte fallback gracefully - # to ensure the underlying 16-byte data integrity is preserved. + + # PyArrow nightly / Python 3.14 currently returns raw bytes instead + # of UUID objects due to an upstream object-casting quirk. + # We handle the raw byte fallback gracefully to ensure the + # underlying 16-byte data integrity is preserved. if len(result) > 0 and isinstance(result.loc[0, "id"], bytes): result["id"] = result["id"].apply(lambda x: uuid.UUID(bytes=x)) - - tm.assert_frame_equal(result, df) + + tm.assert_frame_equal(result, df) \ No newline at end of file From 8925886358f58fd0c87c13c17e5a3b90804d7215 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Sat, 16 May 2026 17:05:23 +0000 Subject: [PATCH 11/25] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- pandas/tests/io/test_parquet.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/pandas/tests/io/test_parquet.py b/pandas/tests/io/test_parquet.py index b478a63e82..e4500845a8 100644 --- a/pandas/tests/io/test_parquet.py +++ b/pandas/tests/io/test_parquet.py @@ -1523,23 +1523,25 @@ def test_invalid_dtype_backend(self, engine, temp_file): df.to_parquet(temp_file) with pytest.raises(ValueError, match=msg): read_parquet(temp_file, dtype_backend="numpy") + + @td.skip_if_no("pyarrow", min_version="24.0") def test_to_parquet_uuid_supported(tmp_path): # GH 61602 df = pd.DataFrame({"id": [uuid.uuid4(), uuid.uuid4()]}) path = tmp_path / "test_uuid.parquet" - + # This should not raise an error df.to_parquet(path, engine="pyarrow") - + # Verify it can be read back result = read_parquet(path, engine="pyarrow") - + # PyArrow nightly / Python 3.14 currently returns raw bytes instead # of UUID objects due to an upstream object-casting quirk. # We handle the raw byte fallback gracefully to ensure the # underlying 16-byte data integrity is preserved. if len(result) > 0 and isinstance(result.loc[0, "id"], bytes): result["id"] = result["id"].apply(lambda x: uuid.UUID(bytes=x)) - - tm.assert_frame_equal(result, df) \ No newline at end of file + + tm.assert_frame_equal(result, df) From 0139402c6a82b9dce8cbf7fd4c7878e9a3a04539 Mon Sep 17 00:00:00 2001 From: GiTaDi-CrEaTe Date: Sun, 17 May 2026 06:54:30 +0530 Subject: [PATCH 12/25] TST: Use temp_file fixture instead of tmp_path --- pandas/tests/io/test_parquet.py | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/pandas/tests/io/test_parquet.py b/pandas/tests/io/test_parquet.py index e4500845a8..93274d4c13 100644 --- a/pandas/tests/io/test_parquet.py +++ b/pandas/tests/io/test_parquet.py @@ -1526,22 +1526,21 @@ def test_invalid_dtype_backend(self, engine, temp_file): @td.skip_if_no("pyarrow", min_version="24.0") -def test_to_parquet_uuid_supported(tmp_path): +def test_to_parquet_uuid_supported(temp_file): # GH 61602 df = pd.DataFrame({"id": [uuid.uuid4(), uuid.uuid4()]}) - path = tmp_path / "test_uuid.parquet" - + # This should not raise an error - df.to_parquet(path, engine="pyarrow") - + df.to_parquet(temp_file, engine="pyarrow") + # Verify it can be read back - result = read_parquet(path, engine="pyarrow") - + result = read_parquet(temp_file, engine="pyarrow") + # PyArrow nightly / Python 3.14 currently returns raw bytes instead # of UUID objects due to an upstream object-casting quirk. # We handle the raw byte fallback gracefully to ensure the # underlying 16-byte data integrity is preserved. if len(result) > 0 and isinstance(result.loc[0, "id"], bytes): result["id"] = result["id"].apply(lambda x: uuid.UUID(bytes=x)) - - tm.assert_frame_equal(result, df) + + tm.assert_frame_equal(result, df) \ No newline at end of file From 9053a755e3d56d4674741f5e2eb484965734ba9a Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Sun, 17 May 2026 01:32:08 +0000 Subject: [PATCH 13/25] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- pandas/tests/io/test_parquet.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pandas/tests/io/test_parquet.py b/pandas/tests/io/test_parquet.py index 93274d4c13..ec2ae1058e 100644 --- a/pandas/tests/io/test_parquet.py +++ b/pandas/tests/io/test_parquet.py @@ -1529,18 +1529,18 @@ def test_invalid_dtype_backend(self, engine, temp_file): def test_to_parquet_uuid_supported(temp_file): # GH 61602 df = pd.DataFrame({"id": [uuid.uuid4(), uuid.uuid4()]}) - + # This should not raise an error df.to_parquet(temp_file, engine="pyarrow") - + # Verify it can be read back result = read_parquet(temp_file, engine="pyarrow") - + # PyArrow nightly / Python 3.14 currently returns raw bytes instead # of UUID objects due to an upstream object-casting quirk. # We handle the raw byte fallback gracefully to ensure the # underlying 16-byte data integrity is preserved. if len(result) > 0 and isinstance(result.loc[0, "id"], bytes): result["id"] = result["id"].apply(lambda x: uuid.UUID(bytes=x)) - - tm.assert_frame_equal(result, df) \ No newline at end of file + + tm.assert_frame_equal(result, df) From bdd3ae32a1b8ef86a3179195f0da9973887f1ffe Mon Sep 17 00:00:00 2001 From: GiTaDi-CrEaTe Date: Sun, 17 May 2026 18:34:35 +0530 Subject: [PATCH 14/25] TST: Replace UUID byte fallback with pytest.xfail for upstream bug --- pandas/tests/io/test_parquet.py | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/pandas/tests/io/test_parquet.py b/pandas/tests/io/test_parquet.py index ec2ae1058e..576da3f36b 100644 --- a/pandas/tests/io/test_parquet.py +++ b/pandas/tests/io/test_parquet.py @@ -1529,18 +1529,12 @@ def test_invalid_dtype_backend(self, engine, temp_file): def test_to_parquet_uuid_supported(temp_file): # GH 61602 df = pd.DataFrame({"id": [uuid.uuid4(), uuid.uuid4()]}) - - # This should not raise an error + df.to_parquet(temp_file, engine="pyarrow") - - # Verify it can be read back result = read_parquet(temp_file, engine="pyarrow") - - # PyArrow nightly / Python 3.14 currently returns raw bytes instead - # of UUID objects due to an upstream object-casting quirk. - # We handle the raw byte fallback gracefully to ensure the - # underlying 16-byte data integrity is preserved. + + # If upstream PyArrow nightly/py314 returns raw bytes instead of UUIDs, xfail if len(result) > 0 and isinstance(result.loc[0, "id"], bytes): - result["id"] = result["id"].apply(lambda x: uuid.UUID(bytes=x)) - + pytest.xfail("Upstream PyArrow nightly bug: returns raw bytes instead of UUIDs") + tm.assert_frame_equal(result, df) From b244666906f751ebe37c3ae4bad3d8de3b86a0ff Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Sun, 17 May 2026 13:08:46 +0000 Subject: [PATCH 15/25] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- pandas/tests/io/test_parquet.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pandas/tests/io/test_parquet.py b/pandas/tests/io/test_parquet.py index 576da3f36b..c604e6f2a0 100644 --- a/pandas/tests/io/test_parquet.py +++ b/pandas/tests/io/test_parquet.py @@ -1529,12 +1529,12 @@ def test_invalid_dtype_backend(self, engine, temp_file): def test_to_parquet_uuid_supported(temp_file): # GH 61602 df = pd.DataFrame({"id": [uuid.uuid4(), uuid.uuid4()]}) - + df.to_parquet(temp_file, engine="pyarrow") result = read_parquet(temp_file, engine="pyarrow") - + # If upstream PyArrow nightly/py314 returns raw bytes instead of UUIDs, xfail if len(result) > 0 and isinstance(result.loc[0, "id"], bytes): pytest.xfail("Upstream PyArrow nightly bug: returns raw bytes instead of UUIDs") - + tm.assert_frame_equal(result, df) From 764647b9fb87c096562d8c51c46b720470eb4c52 Mon Sep 17 00:00:00 2001 From: GiTaDi-CrEaTe Date: Sun, 17 May 2026 18:45:48 +0530 Subject: [PATCH 16/25] TST: Refactor dynamic xfail to use request.node.add_marker --- pandas/tests/io/test_parquet.py | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/pandas/tests/io/test_parquet.py b/pandas/tests/io/test_parquet.py index c604e6f2a0..87de139214 100644 --- a/pandas/tests/io/test_parquet.py +++ b/pandas/tests/io/test_parquet.py @@ -1526,15 +1526,20 @@ def test_invalid_dtype_backend(self, engine, temp_file): @td.skip_if_no("pyarrow", min_version="24.0") -def test_to_parquet_uuid_supported(temp_file): +def test_to_parquet_uuid_supported(temp_file, request): # GH 61602 df = pd.DataFrame({"id": [uuid.uuid4(), uuid.uuid4()]}) - + df.to_parquet(temp_file, engine="pyarrow") result = read_parquet(temp_file, engine="pyarrow") - - # If upstream PyArrow nightly/py314 returns raw bytes instead of UUIDs, xfail + + # If upstream PyArrow nightly/py314 returns raw bytes instead of UUIDs, + # we dynamically add the xfail marker to satisfy both Ruff and Pandas architecture. if len(result) > 0 and isinstance(result.loc[0, "id"], bytes): - pytest.xfail("Upstream PyArrow nightly bug: returns raw bytes instead of UUIDs") - + request.node.add_marker( + pytest.mark.xfail( + reason="Upstream PyArrow nightly bug: returns raw bytes instead of UUIDs" + ) + ) + tm.assert_frame_equal(result, df) From 9fe47457cd6babfe0da1009f402a320ab91c3ea9 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Sun, 17 May 2026 13:21:07 +0000 Subject: [PATCH 17/25] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- pandas/tests/io/test_parquet.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pandas/tests/io/test_parquet.py b/pandas/tests/io/test_parquet.py index 87de139214..7a2dcdc927 100644 --- a/pandas/tests/io/test_parquet.py +++ b/pandas/tests/io/test_parquet.py @@ -1529,10 +1529,10 @@ def test_invalid_dtype_backend(self, engine, temp_file): def test_to_parquet_uuid_supported(temp_file, request): # GH 61602 df = pd.DataFrame({"id": [uuid.uuid4(), uuid.uuid4()]}) - + df.to_parquet(temp_file, engine="pyarrow") result = read_parquet(temp_file, engine="pyarrow") - + # If upstream PyArrow nightly/py314 returns raw bytes instead of UUIDs, # we dynamically add the xfail marker to satisfy both Ruff and Pandas architecture. if len(result) > 0 and isinstance(result.loc[0, "id"], bytes): @@ -1541,5 +1541,5 @@ def test_to_parquet_uuid_supported(temp_file, request): reason="Upstream PyArrow nightly bug: returns raw bytes instead of UUIDs" ) ) - + tm.assert_frame_equal(result, df) From 07ccaef5f421a91442aacb285c06291aea3e426c Mon Sep 17 00:00:00 2001 From: GiTaDi-CrEaTe Date: Sun, 17 May 2026 18:56:17 +0530 Subject: [PATCH 18/25] TST: Shorten xfail reason string to pass ruff line length --- pandas/tests/io/test_parquet.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandas/tests/io/test_parquet.py b/pandas/tests/io/test_parquet.py index 7a2dcdc927..723310d789 100644 --- a/pandas/tests/io/test_parquet.py +++ b/pandas/tests/io/test_parquet.py @@ -1538,7 +1538,7 @@ def test_to_parquet_uuid_supported(temp_file, request): if len(result) > 0 and isinstance(result.loc[0, "id"], bytes): request.node.add_marker( pytest.mark.xfail( - reason="Upstream PyArrow nightly bug: returns raw bytes instead of UUIDs" + reason="PyArrow nightly bug: returns raw bytes instead of UUIDs" ) ) From a09deb0c772542dd3ebe0b426ad052363c93dc63 Mon Sep 17 00:00:00 2001 From: GiTaDi-CrEaTe Date: Tue, 9 Jun 2026 10:53:39 +0530 Subject: [PATCH 19/25] TST: Unconditionally xfail UUID pyarrow test per reviewer request --- pandas/tests/io/test_parquet.py | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/pandas/tests/io/test_parquet.py b/pandas/tests/io/test_parquet.py index 723310d789..9048e562ae 100644 --- a/pandas/tests/io/test_parquet.py +++ b/pandas/tests/io/test_parquet.py @@ -1525,21 +1525,15 @@ def test_invalid_dtype_backend(self, engine, temp_file): read_parquet(temp_file, dtype_backend="numpy") -@td.skip_if_no("pyarrow", min_version="24.0") -def test_to_parquet_uuid_supported(temp_file, request): +@td.skip_if_no("pyarrow", min_version="24.0.0") +@pytest.mark.xfail( + reason="Upstream PyArrow nightly/py314 fails to cast FIXED_LEN_BYTE_ARRAY to UUID - GH 61602" +) +def test_to_parquet_uuid_supported(temp_file): # GH 61602 df = pd.DataFrame({"id": [uuid.uuid4(), uuid.uuid4()]}) - + df.to_parquet(temp_file, engine="pyarrow") - result = read_parquet(temp_file, engine="pyarrow") - - # If upstream PyArrow nightly/py314 returns raw bytes instead of UUIDs, - # we dynamically add the xfail marker to satisfy both Ruff and Pandas architecture. - if len(result) > 0 and isinstance(result.loc[0, "id"], bytes): - request.node.add_marker( - pytest.mark.xfail( - reason="PyArrow nightly bug: returns raw bytes instead of UUIDs" - ) - ) - + + result = pd.read_parquet(temp_file, engine="pyarrow") tm.assert_frame_equal(result, df) From 1ad08a5be5d47b2511ed5db00ee0233e564a13d6 Mon Sep 17 00:00:00 2001 From: GiTaDi-CrEaTe Date: Wed, 10 Jun 2026 11:19:48 +0530 Subject: [PATCH 20/25] TST: Fix ruff line length and read_parquet namespace usage --- pandas/tests/io/test_parquet.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/pandas/tests/io/test_parquet.py b/pandas/tests/io/test_parquet.py index 9048e562ae..fd4afc6f01 100644 --- a/pandas/tests/io/test_parquet.py +++ b/pandas/tests/io/test_parquet.py @@ -1523,11 +1523,12 @@ def test_invalid_dtype_backend(self, engine, temp_file): df.to_parquet(temp_file) with pytest.raises(ValueError, match=msg): read_parquet(temp_file, dtype_backend="numpy") - - @td.skip_if_no("pyarrow", min_version="24.0.0") @pytest.mark.xfail( - reason="Upstream PyArrow nightly/py314 fails to cast FIXED_LEN_BYTE_ARRAY to UUID - GH 61602" + reason=( + "Upstream PyArrow nightly/py314 fails to cast " + "FIXED_LEN_BYTE_ARRAY to UUID - GH 61602" + ) ) def test_to_parquet_uuid_supported(temp_file): # GH 61602 @@ -1535,5 +1536,6 @@ def test_to_parquet_uuid_supported(temp_file): df.to_parquet(temp_file, engine="pyarrow") - result = pd.read_parquet(temp_file, engine="pyarrow") + # Use read_parquet directly to fix the namespace error + result = read_parquet(temp_file, engine="pyarrow") tm.assert_frame_equal(result, df) From 214203b5ddff5ff5b1304883cbfdaeea4bb529b0 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 10 Jun 2026 06:03:31 +0000 Subject: [PATCH 21/25] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- pandas/tests/io/test_parquet.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pandas/tests/io/test_parquet.py b/pandas/tests/io/test_parquet.py index fd4afc6f01..107b242856 100644 --- a/pandas/tests/io/test_parquet.py +++ b/pandas/tests/io/test_parquet.py @@ -1523,6 +1523,8 @@ def test_invalid_dtype_backend(self, engine, temp_file): df.to_parquet(temp_file) with pytest.raises(ValueError, match=msg): read_parquet(temp_file, dtype_backend="numpy") + + @td.skip_if_no("pyarrow", min_version="24.0.0") @pytest.mark.xfail( reason=( @@ -1533,9 +1535,9 @@ def test_invalid_dtype_backend(self, engine, temp_file): def test_to_parquet_uuid_supported(temp_file): # GH 61602 df = pd.DataFrame({"id": [uuid.uuid4(), uuid.uuid4()]}) - + df.to_parquet(temp_file, engine="pyarrow") - + # Use read_parquet directly to fix the namespace error result = read_parquet(temp_file, engine="pyarrow") tm.assert_frame_equal(result, df) From c3ae88c60639813c0e7cef89393a39243f629328 Mon Sep 17 00:00:00 2001 From: GiTaDi-CrEaTe Date: Wed, 1 Jul 2026 12:20:19 +0530 Subject: [PATCH 22/25] TST: Unconditionally xfail UUID pyarrow test and link upstream Arrow bug --- pandas/tests/io/test_parquet.py | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/pandas/tests/io/test_parquet.py b/pandas/tests/io/test_parquet.py index 107b242856..79df4865be 100644 --- a/pandas/tests/io/test_parquet.py +++ b/pandas/tests/io/test_parquet.py @@ -1525,19 +1525,22 @@ def test_invalid_dtype_backend(self, engine, temp_file): read_parquet(temp_file, dtype_backend="numpy") -@td.skip_if_no("pyarrow", min_version="24.0.0") @pytest.mark.xfail( reason=( - "Upstream PyArrow nightly/py314 fails to cast " - "FIXED_LEN_BYTE_ARRAY to UUID - GH 61602" + "Upstream PyArrow nightly/py314 fails to cast FIXED_LEN_BYTE_ARRAY " + "to UUID - Pandas GH 61602 / Arrow Issue: https://github.com/apache/arrow/issues/50312" ) ) +@td.skip_if_no("pyarrow", min_version="24.0.0") def test_to_parquet_uuid_supported(temp_file): # GH 61602 - df = pd.DataFrame({"id": [uuid.uuid4(), uuid.uuid4()]}) + expected = pd.DataFrame({"id": [uuid.uuid4(), uuid.uuid4()]}) - df.to_parquet(temp_file, engine="pyarrow") + # Write to parquet + expected.to_parquet(temp_file, engine="pyarrow") - # Use read_parquet directly to fix the namespace error + # Verify it can be read back result = read_parquet(temp_file, engine="pyarrow") - tm.assert_frame_equal(result, df) + + # Strictly assert the frames are equal + tm.assert_frame_equal(result, expected) \ No newline at end of file From a43313dbf773ba4787ffe550f3972841539df8b7 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 1 Jul 2026 06:55:58 +0000 Subject: [PATCH 23/25] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- pandas/tests/io/test_parquet.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandas/tests/io/test_parquet.py b/pandas/tests/io/test_parquet.py index 79df4865be..fb7c0e01b7 100644 --- a/pandas/tests/io/test_parquet.py +++ b/pandas/tests/io/test_parquet.py @@ -1543,4 +1543,4 @@ def test_to_parquet_uuid_supported(temp_file): result = read_parquet(temp_file, engine="pyarrow") # Strictly assert the frames are equal - tm.assert_frame_equal(result, expected) \ No newline at end of file + tm.assert_frame_equal(result, expected) From aa6d566fb9ed7316962d71b095d8fa3daf265de8 Mon Sep 17 00:00:00 2001 From: GiTaDi-CrEaTe Date: Thu, 9 Jul 2026 16:45:52 +0530 Subject: [PATCH 24/25] TST: Update xfail reason to reflect stable PyArrow bug --- pandas/tests/io/test_parquet.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/pandas/tests/io/test_parquet.py b/pandas/tests/io/test_parquet.py index fb7c0e01b7..fa7c7b6297 100644 --- a/pandas/tests/io/test_parquet.py +++ b/pandas/tests/io/test_parquet.py @@ -1526,10 +1526,7 @@ def test_invalid_dtype_backend(self, engine, temp_file): @pytest.mark.xfail( - reason=( - "Upstream PyArrow nightly/py314 fails to cast FIXED_LEN_BYTE_ARRAY " - "to UUID - Pandas GH 61602 / Arrow Issue: https://github.com/apache/arrow/issues/50312" - ) + reason="Upstream PyArrow fails to cast FIXED_LEN_BYTE_ARRAY to UUID - GH 61602" ) @td.skip_if_no("pyarrow", min_version="24.0.0") def test_to_parquet_uuid_supported(temp_file): From e0d617421a813bd217486eb2633fa708b37359d1 Mon Sep 17 00:00:00 2001 From: GiTaDi-CrEaTe Date: Sat, 1 Aug 2026 20:59:28 +0530 Subject: [PATCH 25/25] TST: Remove comments per reviewer request --- pandas/tests/io/test_parquet.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/pandas/tests/io/test_parquet.py b/pandas/tests/io/test_parquet.py index fa7c7b6297..29167a8383 100644 --- a/pandas/tests/io/test_parquet.py +++ b/pandas/tests/io/test_parquet.py @@ -1533,11 +1533,8 @@ def test_to_parquet_uuid_supported(temp_file): # GH 61602 expected = pd.DataFrame({"id": [uuid.uuid4(), uuid.uuid4()]}) - # Write to parquet expected.to_parquet(temp_file, engine="pyarrow") - # Verify it can be read back result = read_parquet(temp_file, engine="pyarrow") - # Strictly assert the frames are equal tm.assert_frame_equal(result, expected)