13
13
14
14
from pandas ._config import get_option
15
15
16
- from pandas .compat import PY310
17
16
from pandas .compat .pyarrow import (
18
17
pa_version_under2p0 ,
19
18
pa_version_under5p0 ,
@@ -262,7 +261,6 @@ def test_options_py(df_compat, pa):
262
261
check_round_trip (df_compat )
263
262
264
263
265
- @pytest .mark .xfail (PY310 , reason = "fastparquet failing on 3.10" )
266
264
def test_options_fp (df_compat , fp ):
267
265
# use the set option
268
266
@@ -340,7 +338,6 @@ def test_get_engine_auto_error_message():
340
338
get_engine ("auto" )
341
339
342
340
343
- @pytest .mark .xfail (PY310 , reason = "fastparquet failing on 3.10" )
344
341
def test_cross_engine_pa_fp (df_cross_compat , pa , fp ):
345
342
# cross-compat with differing reading/writing engines
346
343
@@ -407,11 +404,7 @@ def test_error(self, engine):
407
404
msg = "to_parquet only supports IO with DataFrames"
408
405
self .check_error_on_write (obj , engine , ValueError , msg )
409
406
410
- def test_columns_dtypes (self , request , engine ):
411
- if PY310 and engine == "fastparquet" :
412
- request .node .add_marker (
413
- pytest .mark .xfail (reason = "fastparquet failing on 3.10" )
414
- )
407
+ def test_columns_dtypes (self , engine ):
415
408
df = pd .DataFrame ({"string" : list ("abc" ), "int" : list (range (1 , 4 ))})
416
409
417
410
# unicode
@@ -438,39 +431,27 @@ def test_columns_dtypes_invalid(self, engine):
438
431
self .check_error_on_write (df , engine , ValueError , msg )
439
432
440
433
@pytest .mark .parametrize ("compression" , [None , "gzip" , "snappy" , "brotli" ])
441
- def test_compression (self , engine , compression , request ):
434
+ def test_compression (self , engine , compression ):
442
435
443
436
if compression == "snappy" :
444
437
pytest .importorskip ("snappy" )
445
438
446
439
elif compression == "brotli" :
447
440
pytest .importorskip ("brotli" )
448
441
449
- if PY310 and engine == "fastparquet" :
450
- request .node .add_marker (
451
- pytest .mark .xfail (reason = "fastparquet failing on 3.10" )
452
- )
453
442
df = pd .DataFrame ({"A" : [1 , 2 , 3 ]})
454
443
check_round_trip (df , engine , write_kwargs = {"compression" : compression })
455
444
456
- def test_read_columns (self , engine , request ):
445
+ def test_read_columns (self , engine ):
457
446
# GH18154
458
- if PY310 and engine == "fastparquet" :
459
- request .node .add_marker (
460
- pytest .mark .xfail (reason = "fastparquet failing on 3.10" )
461
- )
462
447
df = pd .DataFrame ({"string" : list ("abc" ), "int" : list (range (1 , 4 ))})
463
448
464
449
expected = pd .DataFrame ({"string" : list ("abc" )})
465
450
check_round_trip (
466
451
df , engine , expected = expected , read_kwargs = {"columns" : ["string" ]}
467
452
)
468
453
469
- def test_write_index (self , engine , request ):
470
- if PY310 and engine == "fastparquet" :
471
- request .node .add_marker (
472
- pytest .mark .xfail (reason = "fastparquet failing on 3.10" )
473
- )
454
+ def test_write_index (self , engine ):
474
455
check_names = engine != "fastparquet"
475
456
476
457
df = pd .DataFrame ({"A" : [1 , 2 , 3 ]})
@@ -519,13 +500,9 @@ def test_multiindex_with_columns(self, pa):
519
500
df , engine , read_kwargs = {"columns" : ["A" , "B" ]}, expected = df [["A" , "B" ]]
520
501
)
521
502
522
- def test_write_ignoring_index (self , engine , request ):
503
+ def test_write_ignoring_index (self , engine ):
523
504
# ENH 20768
524
505
# Ensure index=False omits the index from the written Parquet file.
525
- if PY310 and engine == "fastparquet" :
526
- request .node .add_marker (
527
- pytest .mark .xfail (reason = "fastparquet failing on 3.10" )
528
- )
529
506
df = pd .DataFrame ({"a" : [1 , 2 , 3 ], "b" : ["q" , "r" , "s" ]})
530
507
531
508
write_kwargs = {"compression" : None , "index" : False }
@@ -981,7 +958,6 @@ def test_read_parquet_manager(self, pa, using_array_manager):
981
958
982
959
983
960
class TestParquetFastParquet (Base ):
984
- @pytest .mark .xfail (PY310 , reason = "fastparquet failing on 3.10" )
985
961
def test_basic (self , fp , df_full ):
986
962
df = df_full
987
963
@@ -999,7 +975,6 @@ def test_duplicate_columns(self, fp):
999
975
msg = "Cannot create parquet dataset with duplicate column names"
1000
976
self .check_error_on_write (df , fp , ValueError , msg )
1001
977
1002
- @pytest .mark .xfail (PY310 , reason = "fastparquet failing on 3.10" )
1003
978
def test_bool_with_none (self , fp ):
1004
979
df = pd .DataFrame ({"a" : [True , None , False ]})
1005
980
expected = pd .DataFrame ({"a" : [1.0 , np .nan , 0.0 ]}, dtype = "float16" )
@@ -1019,12 +994,10 @@ def test_unsupported(self, fp):
1019
994
msg = "Can't infer object conversion type"
1020
995
self .check_error_on_write (df , fp , ValueError , msg )
1021
996
1022
- @pytest .mark .xfail (PY310 , reason = "fastparquet failing on 3.10" )
1023
997
def test_categorical (self , fp ):
1024
998
df = pd .DataFrame ({"a" : pd .Categorical (list ("abc" ))})
1025
999
check_round_trip (df , fp )
1026
1000
1027
- @pytest .mark .xfail (PY310 , reason = "fastparquet failing on 3.10" )
1028
1001
def test_filter_row_groups (self , fp ):
1029
1002
d = {"a" : list (range (0 , 3 ))}
1030
1003
df = pd .DataFrame (d )
@@ -1043,7 +1016,6 @@ def test_s3_roundtrip(self, df_compat, s3_resource, fp, s3so):
1043
1016
write_kwargs = {"compression" : None , "storage_options" : s3so },
1044
1017
)
1045
1018
1046
- @pytest .mark .xfail (PY310 , reason = "fastparquet failing on 3.10" )
1047
1019
def test_partition_cols_supported (self , fp , df_full ):
1048
1020
# GH #23283
1049
1021
partition_cols = ["bool" , "int" ]
@@ -1061,7 +1033,6 @@ def test_partition_cols_supported(self, fp, df_full):
1061
1033
actual_partition_cols = fastparquet .ParquetFile (path , False ).cats
1062
1034
assert len (actual_partition_cols ) == 2
1063
1035
1064
- @pytest .mark .xfail (PY310 , reason = "fastparquet failing on 3.10" )
1065
1036
def test_partition_cols_string (self , fp , df_full ):
1066
1037
# GH #27117
1067
1038
partition_cols = "bool"
@@ -1079,7 +1050,6 @@ def test_partition_cols_string(self, fp, df_full):
1079
1050
actual_partition_cols = fastparquet .ParquetFile (path , False ).cats
1080
1051
assert len (actual_partition_cols ) == 1
1081
1052
1082
- @pytest .mark .xfail (PY310 , reason = "fastparquet failing on 3.10" )
1083
1053
def test_partition_on_supported (self , fp , df_full ):
1084
1054
# GH #23283
1085
1055
partition_cols = ["bool" , "int" ]
@@ -1115,15 +1085,13 @@ def test_error_on_using_partition_cols_and_partition_on(self, fp, df_full):
1115
1085
partition_cols = partition_cols ,
1116
1086
)
1117
1087
1118
- @pytest .mark .xfail (PY310 , reason = "fastparquet failing on 3.10" )
1119
1088
def test_empty_dataframe (self , fp ):
1120
1089
# GH #27339
1121
1090
df = pd .DataFrame ()
1122
1091
expected = df .copy ()
1123
1092
expected .index .name = "index"
1124
1093
check_round_trip (df , fp , expected = expected )
1125
1094
1126
- @pytest .mark .xfail (PY310 , reason = "fastparquet failing on 3.10" )
1127
1095
def test_timezone_aware_index (self , fp , timezone_aware_date_list ):
1128
1096
idx = 5 * [timezone_aware_date_list ]
1129
1097
0 commit comments