Skip to content

Commit 085493b

Browse files
authored
GH-37853: [Python] Remove test and fixture involving fastparquet (#50416)
### Rationale for this change `test_fastparquet_cross_compatibility` is not exercised and when exercised with latest versions it fails because it's not compatible with pandas 3 and it won't be as the project is retired, see: - dask/fastparquet#973 ### What changes are included in this PR? Removal of fixture to mark test as `fastparquet` and remove single test that still required fastarquet. ### Are these changes tested? Yes and no. CI is exercised as expected but `fastparquet` tests weren't exercised on CI in the first place. ### Are there any user-facing changes? No * GitHub Issue: #37853 Authored-by: Raúl Cumplido <raulcumplido@gmail.com> Signed-off-by: Raúl Cumplido <raulcumplido@gmail.com>
1 parent 32513fe commit 085493b

2 files changed

Lines changed: 0 additions & 51 deletions

File tree

python/pyarrow/conftest.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@
3333
'cython',
3434
'dataset',
3535
'hypothesis',
36-
'fastparquet',
3736
'flight',
3837
'gandiva',
3938
'gcs',
@@ -69,7 +68,6 @@
6968
'bz2': Codec.is_available('bz2'),
7069
'cython': False,
7170
'dataset': False,
72-
'fastparquet': False,
7371
'flight': False,
7472
'gandiva': False,
7573
'gcs': False,
@@ -116,12 +114,6 @@
116114
except ImportError:
117115
pass
118116

119-
try:
120-
import fastparquet # noqa
121-
defaults['fastparquet'] = True
122-
except ImportError:
123-
pass
124-
125117
try:
126118
import warnings
127119
with warnings.catch_warnings():

python/pyarrow/tests/parquet/test_basic.py

Lines changed: 0 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -817,49 +817,6 @@ def test_parquet_file_too_small(tempdir):
817817
pq.read_table(path)
818818

819819

820-
@pytest.mark.pandas
821-
@pytest.mark.fastparquet
822-
@pytest.mark.filterwarnings("ignore:RangeIndex:FutureWarning")
823-
@pytest.mark.filterwarnings("ignore:tostring:DeprecationWarning:fastparquet")
824-
@pytest.mark.filterwarnings("ignore:unclosed file:ResourceWarning")
825-
def test_fastparquet_cross_compatibility(tempdir):
826-
fp = pytest.importorskip('fastparquet')
827-
828-
df = pd.DataFrame(
829-
{
830-
"a": list("abc"),
831-
"b": list(range(1, 4)),
832-
"c": np.arange(4.0, 7.0, dtype="float64"),
833-
"d": [True, False, True],
834-
"e": pd.date_range("20130101", periods=3),
835-
"f": pd.Categorical(["a", "b", "a"]),
836-
# fastparquet writes list as BYTE_ARRAY JSON, so no roundtrip
837-
# "g": [[1, 2], None, [1, 2, 3]],
838-
}
839-
)
840-
table = pa.table(df)
841-
842-
# Arrow -> fastparquet
843-
file_arrow = str(tempdir / "cross_compat_arrow.parquet")
844-
pq.write_table(table, file_arrow, compression=None)
845-
846-
fp_file = fp.ParquetFile(file_arrow)
847-
df_fp = fp_file.to_pandas()
848-
# pandas 3 defaults to StringDtype for strings, fastparquet still returns object
849-
# TODO: remove astype casts once fastparquet supports pandas 3 StringDtype
850-
tm.assert_frame_equal(df_fp, df.astype({"a": object}))
851-
852-
# Fastparquet -> arrow
853-
file_fastparquet = str(tempdir / "cross_compat_fastparquet.parquet")
854-
# fastparquet doesn't support writing pandas 3 StringDtype yet
855-
fp.write(file_fastparquet, df.astype({"a": object}))
856-
857-
table_fp = pq.read_pandas(file_fastparquet)
858-
# for fastparquet written file, categoricals comes back as strings
859-
# (no arrow schema in parquet metadata)
860-
tm.assert_frame_equal(table_fp.to_pandas(), df.astype({"f": object}))
861-
862-
863820
@pytest.mark.parametrize('array_factory', [
864821
lambda: pa.array([0, None] * 10),
865822
lambda: pa.array([0, None] * 10).dictionary_encode(),

0 commit comments

Comments
 (0)