From 7c553c729d52dfe04c1f040ba1d49e2753a8f4de Mon Sep 17 00:00:00 2001 From: Thomas Li <47963215+lithomas1@users.noreply.github.com> Date: Fri, 13 Aug 2021 14:38:24 -0700 Subject: [PATCH] Backport PR #42999: TST: Fix test related to reverting fastparquet nullable support --- pandas/io/parquet.py | 2 +- pandas/tests/io/test_parquet.py | 5 ----- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/pandas/io/parquet.py b/pandas/io/parquet.py index 49384cfb2e554..5671cce1b966d 100644 --- a/pandas/io/parquet.py +++ b/pandas/io/parquet.py @@ -311,7 +311,7 @@ def read( ): parquet_kwargs: dict[str, Any] = {} use_nullable_dtypes = kwargs.pop("use_nullable_dtypes", False) - if Version(self.api.__version__) >= Version("0.7.1"): + if Version(self.api.__version__) >= Version("0.7.0"): # We are disabling nullable dtypes for fastparquet pending discussion parquet_kwargs["pandas_nulls"] = False if use_nullable_dtypes: diff --git a/pandas/tests/io/test_parquet.py b/pandas/tests/io/test_parquet.py index c0e4cde0f01f8..914f68b90ad37 100644 --- a/pandas/tests/io/test_parquet.py +++ b/pandas/tests/io/test_parquet.py @@ -1066,11 +1066,6 @@ def test_timezone_aware_index(self, fp, timezone_aware_date_list): def test_use_nullable_dtypes_not_supported(self, monkeypatch, fp): df = pd.DataFrame({"a": [1, 2]}) - # This is supported now in fastparquet 0.7.1 and above actually - # Still need to ensure that this raises in all versions below - import fastparquet as fp - - monkeypatch.setattr(fp, "__version__", "0.4") with tm.ensure_clean() as path: df.to_parquet(path) with pytest.raises(ValueError, match="not supported for the fastparquet"):