1313
1414from pandas ._config import get_option
1515
16- from pandas .compat import is_platform_windows
16+ from pandas .compat import (
17+ PY310 ,
18+ is_platform_windows ,
19+ )
1720from pandas .compat .pyarrow import (
1821 pa_version_under2p0 ,
1922 pa_version_under5p0 ,
@@ -262,6 +265,7 @@ def test_options_py(df_compat, pa):
262265 check_round_trip (df_compat )
263266
264267
268+ @pytest .mark .xfail (PY310 , reason = "fastparquet failing on 3.10" )
265269def test_options_fp (df_compat , fp ):
266270 # use the set option
267271
@@ -339,6 +343,7 @@ def test_get_engine_auto_error_message():
339343 get_engine ("auto" )
340344
341345
346+ @pytest .mark .xfail (PY310 , reason = "fastparquet failing on 3.10" )
342347def test_cross_engine_pa_fp (df_cross_compat , pa , fp ):
343348 # cross-compat with differing reading/writing engines
344349
@@ -404,7 +409,11 @@ def test_error(self, engine):
404409 msg = "to_parquet only supports IO with DataFrames"
405410 self .check_error_on_write (obj , engine , ValueError , msg )
406411
407- def test_columns_dtypes (self , engine ):
412+ def test_columns_dtypes (self , request , engine ):
413+ if PY310 and engine == "fastparquet" :
414+ request .node .add_marker (
415+ pytest .mark .xfail (reason = "fastparquet failing on 3.10" )
416+ )
408417 df = pd .DataFrame ({"string" : list ("abc" ), "int" : list (range (1 , 4 ))})
409418
410419 # unicode
@@ -431,27 +440,39 @@ def test_columns_dtypes_invalid(self, engine):
431440 self .check_error_on_write (df , engine , ValueError , msg )
432441
433442 @pytest .mark .parametrize ("compression" , [None , "gzip" , "snappy" , "brotli" ])
434- def test_compression (self , engine , compression ):
443+ def test_compression (self , engine , compression , request ):
435444
436445 if compression == "snappy" :
437446 pytest .importorskip ("snappy" )
438447
439448 elif compression == "brotli" :
440449 pytest .importorskip ("brotli" )
441450
451+ if PY310 and engine == "fastparquet" :
452+ request .node .add_marker (
453+ pytest .mark .xfail (reason = "fastparquet failing on 3.10" )
454+ )
442455 df = pd .DataFrame ({"A" : [1 , 2 , 3 ]})
443456 check_round_trip (df , engine , write_kwargs = {"compression" : compression })
444457
445- def test_read_columns (self , engine ):
458+ def test_read_columns (self , engine , request ):
446459 # GH18154
460+ if PY310 and engine == "fastparquet" :
461+ request .node .add_marker (
462+ pytest .mark .xfail (reason = "fastparquet failing on 3.10" )
463+ )
447464 df = pd .DataFrame ({"string" : list ("abc" ), "int" : list (range (1 , 4 ))})
448465
449466 expected = pd .DataFrame ({"string" : list ("abc" )})
450467 check_round_trip (
451468 df , engine , expected = expected , read_kwargs = {"columns" : ["string" ]}
452469 )
453470
454- def test_write_index (self , engine ):
471+ def test_write_index (self , engine , request ):
472+ if PY310 and engine == "fastparquet" :
473+ request .node .add_marker (
474+ pytest .mark .xfail (reason = "fastparquet failing on 3.10" )
475+ )
455476 check_names = engine != "fastparquet"
456477
457478 df = pd .DataFrame ({"A" : [1 , 2 , 3 ]})
@@ -500,9 +521,13 @@ def test_multiindex_with_columns(self, pa):
500521 df , engine , read_kwargs = {"columns" : ["A" , "B" ]}, expected = df [["A" , "B" ]]
501522 )
502523
503- def test_write_ignoring_index (self , engine ):
524+ def test_write_ignoring_index (self , engine , request ):
504525 # ENH 20768
505526 # Ensure index=False omits the index from the written Parquet file.
527+ if PY310 and engine == "fastparquet" :
528+ request .node .add_marker (
529+ pytest .mark .xfail (reason = "fastparquet failing on 3.10" )
530+ )
506531 df = pd .DataFrame ({"a" : [1 , 2 , 3 ], "b" : ["q" , "r" , "s" ]})
507532
508533 write_kwargs = {"compression" : None , "index" : False }
@@ -986,6 +1011,7 @@ def test_read_parquet_manager(self, pa, using_array_manager):
9861011
9871012
9881013class TestParquetFastParquet (Base ):
1014+ @pytest .mark .xfail (PY310 , reason = "fastparquet failing on 3.10" )
9891015 def test_basic (self , fp , df_full ):
9901016 df = df_full
9911017
@@ -1003,6 +1029,7 @@ def test_duplicate_columns(self, fp):
10031029 msg = "Cannot create parquet dataset with duplicate column names"
10041030 self .check_error_on_write (df , fp , ValueError , msg )
10051031
1032+ @pytest .mark .xfail (PY310 , reason = "fastparquet failing on 3.10" )
10061033 def test_bool_with_none (self , fp ):
10071034 df = pd .DataFrame ({"a" : [True , None , False ]})
10081035 expected = pd .DataFrame ({"a" : [1.0 , np .nan , 0.0 ]}, dtype = "float16" )
@@ -1022,10 +1049,12 @@ def test_unsupported(self, fp):
10221049 msg = "Can't infer object conversion type"
10231050 self .check_error_on_write (df , fp , ValueError , msg )
10241051
1052+ @pytest .mark .xfail (PY310 , reason = "fastparquet failing on 3.10" )
10251053 def test_categorical (self , fp ):
10261054 df = pd .DataFrame ({"a" : pd .Categorical (list ("abc" ))})
10271055 check_round_trip (df , fp )
10281056
1057+ @pytest .mark .xfail (PY310 , reason = "fastparquet failing on 3.10" )
10291058 def test_filter_row_groups (self , fp ):
10301059 d = {"a" : list (range (0 , 3 ))}
10311060 df = pd .DataFrame (d )
@@ -1044,6 +1073,7 @@ def test_s3_roundtrip(self, df_compat, s3_resource, fp, s3so):
10441073 write_kwargs = {"compression" : None , "storage_options" : s3so },
10451074 )
10461075
1076+ @pytest .mark .xfail (PY310 , reason = "fastparquet failing on 3.10" )
10471077 def test_partition_cols_supported (self , fp , df_full ):
10481078 # GH #23283
10491079 partition_cols = ["bool" , "int" ]
@@ -1061,6 +1091,7 @@ def test_partition_cols_supported(self, fp, df_full):
10611091 actual_partition_cols = fastparquet .ParquetFile (path , False ).cats
10621092 assert len (actual_partition_cols ) == 2
10631093
1094+ @pytest .mark .xfail (PY310 , reason = "fastparquet failing on 3.10" )
10641095 def test_partition_cols_string (self , fp , df_full ):
10651096 # GH #27117
10661097 partition_cols = "bool"
@@ -1078,6 +1109,7 @@ def test_partition_cols_string(self, fp, df_full):
10781109 actual_partition_cols = fastparquet .ParquetFile (path , False ).cats
10791110 assert len (actual_partition_cols ) == 1
10801111
1112+ @pytest .mark .xfail (PY310 , reason = "fastparquet failing on 3.10" )
10811113 def test_partition_on_supported (self , fp , df_full ):
10821114 # GH #23283
10831115 partition_cols = ["bool" , "int" ]
@@ -1113,13 +1145,15 @@ def test_error_on_using_partition_cols_and_partition_on(self, fp, df_full):
11131145 partition_cols = partition_cols ,
11141146 )
11151147
1148+ @pytest .mark .xfail (PY310 , reason = "fastparquet failing on 3.10" )
11161149 def test_empty_dataframe (self , fp ):
11171150 # GH #27339
11181151 df = pd .DataFrame ()
11191152 expected = df .copy ()
11201153 expected .index .name = "index"
11211154 check_round_trip (df , fp , expected = expected )
11221155
1156+ @pytest .mark .xfail (PY310 , reason = "fastparquet failing on 3.10" )
11231157 def test_timezone_aware_index (self , fp , timezone_aware_date_list ):
11241158 idx = 5 * [timezone_aware_date_list ]
11251159
0 commit comments