13
13
14
14
from pandas ._config import get_option
15
15
16
- from pandas .compat import (
17
- PY310 ,
18
- is_platform_windows ,
19
- )
16
+ from pandas .compat import is_platform_windows
20
17
from pandas .compat .pyarrow import (
21
18
pa_version_under2p0 ,
22
19
pa_version_under5p0 ,
@@ -265,7 +262,6 @@ def test_options_py(df_compat, pa):
265
262
check_round_trip (df_compat )
266
263
267
264
268
- @pytest .mark .xfail (PY310 , reason = "fastparquet failing on 3.10" )
269
265
def test_options_fp (df_compat , fp ):
270
266
# use the set option
271
267
@@ -343,7 +339,6 @@ def test_get_engine_auto_error_message():
343
339
get_engine ("auto" )
344
340
345
341
346
- @pytest .mark .xfail (PY310 , reason = "fastparquet failing on 3.10" )
347
342
def test_cross_engine_pa_fp (df_cross_compat , pa , fp ):
348
343
# cross-compat with differing reading/writing engines
349
344
@@ -409,11 +404,7 @@ def test_error(self, engine):
409
404
msg = "to_parquet only supports IO with DataFrames"
410
405
self .check_error_on_write (obj , engine , ValueError , msg )
411
406
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
- )
407
+ def test_columns_dtypes (self , engine ):
417
408
df = pd .DataFrame ({"string" : list ("abc" ), "int" : list (range (1 , 4 ))})
418
409
419
410
# unicode
@@ -440,39 +431,27 @@ def test_columns_dtypes_invalid(self, engine):
440
431
self .check_error_on_write (df , engine , ValueError , msg )
441
432
442
433
@pytest .mark .parametrize ("compression" , [None , "gzip" , "snappy" , "brotli" ])
443
- def test_compression (self , engine , compression , request ):
434
+ def test_compression (self , engine , compression ):
444
435
445
436
if compression == "snappy" :
446
437
pytest .importorskip ("snappy" )
447
438
448
439
elif compression == "brotli" :
449
440
pytest .importorskip ("brotli" )
450
441
451
- if PY310 and engine == "fastparquet" :
452
- request .node .add_marker (
453
- pytest .mark .xfail (reason = "fastparquet failing on 3.10" )
454
- )
455
442
df = pd .DataFrame ({"A" : [1 , 2 , 3 ]})
456
443
check_round_trip (df , engine , write_kwargs = {"compression" : compression })
457
444
458
- def test_read_columns (self , engine , request ):
445
+ def test_read_columns (self , engine ):
459
446
# GH18154
460
- if PY310 and engine == "fastparquet" :
461
- request .node .add_marker (
462
- pytest .mark .xfail (reason = "fastparquet failing on 3.10" )
463
- )
464
447
df = pd .DataFrame ({"string" : list ("abc" ), "int" : list (range (1 , 4 ))})
465
448
466
449
expected = pd .DataFrame ({"string" : list ("abc" )})
467
450
check_round_trip (
468
451
df , engine , expected = expected , read_kwargs = {"columns" : ["string" ]}
469
452
)
470
453
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
- )
454
+ def test_write_index (self , engine ):
476
455
check_names = engine != "fastparquet"
477
456
478
457
df = pd .DataFrame ({"A" : [1 , 2 , 3 ]})
@@ -521,13 +500,9 @@ def test_multiindex_with_columns(self, pa):
521
500
df , engine , read_kwargs = {"columns" : ["A" , "B" ]}, expected = df [["A" , "B" ]]
522
501
)
523
502
524
- def test_write_ignoring_index (self , engine , request ):
503
+ def test_write_ignoring_index (self , engine ):
525
504
# ENH 20768
526
505
# 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
- )
531
506
df = pd .DataFrame ({"a" : [1 , 2 , 3 ], "b" : ["q" , "r" , "s" ]})
532
507
533
508
write_kwargs = {"compression" : None , "index" : False }
@@ -1011,7 +986,6 @@ def test_read_parquet_manager(self, pa, using_array_manager):
1011
986
1012
987
1013
988
class TestParquetFastParquet (Base ):
1014
- @pytest .mark .xfail (PY310 , reason = "fastparquet failing on 3.10" )
1015
989
def test_basic (self , fp , df_full ):
1016
990
df = df_full
1017
991
@@ -1029,7 +1003,6 @@ def test_duplicate_columns(self, fp):
1029
1003
msg = "Cannot create parquet dataset with duplicate column names"
1030
1004
self .check_error_on_write (df , fp , ValueError , msg )
1031
1005
1032
- @pytest .mark .xfail (PY310 , reason = "fastparquet failing on 3.10" )
1033
1006
def test_bool_with_none (self , fp ):
1034
1007
df = pd .DataFrame ({"a" : [True , None , False ]})
1035
1008
expected = pd .DataFrame ({"a" : [1.0 , np .nan , 0.0 ]}, dtype = "float16" )
@@ -1049,12 +1022,10 @@ def test_unsupported(self, fp):
1049
1022
msg = "Can't infer object conversion type"
1050
1023
self .check_error_on_write (df , fp , ValueError , msg )
1051
1024
1052
- @pytest .mark .xfail (PY310 , reason = "fastparquet failing on 3.10" )
1053
1025
def test_categorical (self , fp ):
1054
1026
df = pd .DataFrame ({"a" : pd .Categorical (list ("abc" ))})
1055
1027
check_round_trip (df , fp )
1056
1028
1057
- @pytest .mark .xfail (PY310 , reason = "fastparquet failing on 3.10" )
1058
1029
def test_filter_row_groups (self , fp ):
1059
1030
d = {"a" : list (range (0 , 3 ))}
1060
1031
df = pd .DataFrame (d )
@@ -1073,7 +1044,6 @@ def test_s3_roundtrip(self, df_compat, s3_resource, fp, s3so):
1073
1044
write_kwargs = {"compression" : None , "storage_options" : s3so },
1074
1045
)
1075
1046
1076
- @pytest .mark .xfail (PY310 , reason = "fastparquet failing on 3.10" )
1077
1047
def test_partition_cols_supported (self , fp , df_full ):
1078
1048
# GH #23283
1079
1049
partition_cols = ["bool" , "int" ]
@@ -1091,7 +1061,6 @@ def test_partition_cols_supported(self, fp, df_full):
1091
1061
actual_partition_cols = fastparquet .ParquetFile (path , False ).cats
1092
1062
assert len (actual_partition_cols ) == 2
1093
1063
1094
- @pytest .mark .xfail (PY310 , reason = "fastparquet failing on 3.10" )
1095
1064
def test_partition_cols_string (self , fp , df_full ):
1096
1065
# GH #27117
1097
1066
partition_cols = "bool"
@@ -1109,7 +1078,6 @@ def test_partition_cols_string(self, fp, df_full):
1109
1078
actual_partition_cols = fastparquet .ParquetFile (path , False ).cats
1110
1079
assert len (actual_partition_cols ) == 1
1111
1080
1112
- @pytest .mark .xfail (PY310 , reason = "fastparquet failing on 3.10" )
1113
1081
def test_partition_on_supported (self , fp , df_full ):
1114
1082
# GH #23283
1115
1083
partition_cols = ["bool" , "int" ]
@@ -1145,15 +1113,13 @@ def test_error_on_using_partition_cols_and_partition_on(self, fp, df_full):
1145
1113
partition_cols = partition_cols ,
1146
1114
)
1147
1115
1148
- @pytest .mark .xfail (PY310 , reason = "fastparquet failing on 3.10" )
1149
1116
def test_empty_dataframe (self , fp ):
1150
1117
# GH #27339
1151
1118
df = pd .DataFrame ()
1152
1119
expected = df .copy ()
1153
1120
expected .index .name = "index"
1154
1121
check_round_trip (df , fp , expected = expected )
1155
1122
1156
- @pytest .mark .xfail (PY310 , reason = "fastparquet failing on 3.10" )
1157
1123
def test_timezone_aware_index (self , fp , timezone_aware_date_list ):
1158
1124
idx = 5 * [timezone_aware_date_list ]
1159
1125
0 commit comments