@@ -174,10 +174,10 @@ def test_usecols_list(self, request, engine, read_ext, df_ref):
174
174
reason = "Sheets containing datetimes not supported by pyxlsb"
175
175
)
176
176
)
177
- if engine == "calamine" and read_ext in {".xls" , ".xlsb" , ".ods" }:
177
+ if engine == "calamine" and read_ext in {".xls" , ".xlsb" }:
178
178
request .node .add_marker (
179
179
pytest .mark .xfail (
180
- reason = "Calamine support parsing datetime only in xlsx"
180
+ reason = "Calamine support parsing datetime only in xlsx/ods "
181
181
)
182
182
)
183
183
@@ -204,10 +204,10 @@ def test_usecols_str(self, request, engine, read_ext, df_ref):
204
204
reason = "Sheets containing datetimes not supported by pyxlsb"
205
205
)
206
206
)
207
- if engine == "calamine" and read_ext in {".xls" , ".xlsb" , ".ods" }:
207
+ if engine == "calamine" and read_ext in {".xls" , ".xlsb" }:
208
208
request .node .add_marker (
209
209
pytest .mark .xfail (
210
- reason = "Calamine support parsing datetime only in xlsx"
210
+ reason = "Calamine support parsing datetime only in xlsx/ods "
211
211
)
212
212
)
213
213
@@ -268,10 +268,10 @@ def test_usecols_diff_positional_int_columns_order(
268
268
reason = "Sheets containing datetimes not supported by pyxlsb"
269
269
)
270
270
)
271
- if engine == "calamine" and read_ext in {".xls" , ".xlsb" , ".ods" }:
271
+ if engine == "calamine" and read_ext in {".xls" , ".xlsb" }:
272
272
request .node .add_marker (
273
273
pytest .mark .xfail (
274
- reason = "Calamine support parsing datetime only in xlsx"
274
+ reason = "Calamine support parsing datetime only in xlsx/ods "
275
275
)
276
276
)
277
277
@@ -296,10 +296,10 @@ def test_read_excel_without_slicing(self, request, engine, read_ext, df_ref):
296
296
reason = "Sheets containing datetimes not supported by pyxlsb"
297
297
)
298
298
)
299
- if engine == "calamine" and read_ext in {".xls" , ".xlsb" , ".ods" }:
299
+ if engine == "calamine" and read_ext in {".xls" , ".xlsb" }:
300
300
request .node .add_marker (
301
301
pytest .mark .xfail (
302
- reason = "Calamine support parsing datetime only in xlsx"
302
+ reason = "Calamine support parsing datetime only in xlsx/ods "
303
303
)
304
304
)
305
305
@@ -314,10 +314,10 @@ def test_usecols_excel_range_str(self, request, engine, read_ext, df_ref):
314
314
reason = "Sheets containing datetimes not supported by pyxlsb"
315
315
)
316
316
)
317
- if engine == "calamine" and read_ext in {".xls" , ".xlsb" , ".ods" }:
317
+ if engine == "calamine" and read_ext in {".xls" , ".xlsb" }:
318
318
request .node .add_marker (
319
319
pytest .mark .xfail (
320
- reason = "Calamine support parsing datetime only in xlsx"
320
+ reason = "Calamine support parsing datetime only in xlsx/ods "
321
321
)
322
322
)
323
323
@@ -400,11 +400,9 @@ def test_excel_cell_error_na(self, request, engine, read_ext):
400
400
reason = "Sheets containing datetimes not supported by pyxlsb"
401
401
)
402
402
)
403
- if engine == "calamine" and read_ext in { ".ods" } :
403
+ if engine == "calamine" and read_ext == ".ods" :
404
404
request .node .add_marker (
405
- pytest .mark .xfail (
406
- reason = "Calamine support parsing datetime only in xlsx"
407
- )
405
+ pytest .mark .xfail (reason = "Calamine returns 0 instead of NaN in ods" )
408
406
)
409
407
410
408
parsed = pd .read_excel ("test3" + read_ext , sheet_name = "Sheet1" )
@@ -418,10 +416,10 @@ def test_excel_table(self, request, engine, read_ext, df_ref):
418
416
reason = "Sheets containing datetimes not supported by pyxlsb"
419
417
)
420
418
)
421
- if engine == "calamine" and read_ext in {".xls" , ".xlsb" , ".ods" }:
419
+ if engine == "calamine" and read_ext in {".xls" , ".xlsb" }:
422
420
request .node .add_marker (
423
421
pytest .mark .xfail (
424
- reason = "Calamine support parsing datetime only in xlsx"
422
+ reason = "Calamine support parsing datetime only in xlsx/ods "
425
423
)
426
424
)
427
425
@@ -445,15 +443,15 @@ def test_reader_special_dtypes(self, request, engine, read_ext):
445
443
reason = "Sheets containing datetimes not supported by pyxlsb"
446
444
)
447
445
)
448
- if engine == "calamine" and read_ext in {".xls" , ".xlsb" , ".ods" }:
446
+ if engine == "calamine" and read_ext in {".xls" , ".xlsb" }:
449
447
request .node .add_marker (
450
448
pytest .mark .xfail (
451
- reason = "Calamine support parsing datetime only in xlsx"
449
+ reason = "Calamine support parsing datetime only in xlsx/ods "
452
450
)
453
451
)
454
- if engine == "calamine" :
452
+ if engine == "calamine" and read_ext != ".ods" :
455
453
request .node .add_marker (
456
- pytest .mark .xfail (reason = "Calamine can't parse this datetime format " )
454
+ pytest .mark .xfail (reason = "Maybe not supported by calamine " )
457
455
)
458
456
459
457
expected = DataFrame .from_dict (
@@ -715,13 +713,6 @@ def test_dtype_mangle_dup_cols(self, read_ext, dtypes, exp_value):
715
713
716
714
def test_reader_spaces (self , request , engine , read_ext ):
717
715
# see gh-32207
718
-
719
- # https://github.com/tafia/calamine/pull/289
720
- if engine == "calamine" and read_ext == ".ods" :
721
- request .node .add_marker (
722
- pytest .mark .xfail (reason = "Calamine doesn't respect spaces in ods" )
723
- )
724
-
725
716
basename = "test_spaces"
726
717
727
718
actual = pd .read_excel (basename + read_ext )
@@ -826,7 +817,7 @@ def test_date_conversion_overflow(self, request, engine, read_ext):
826
817
columns = ["DateColWithBigInt" , "StringCol" ],
827
818
)
828
819
829
- if engine == "calamine" :
820
+ if engine == "calamine" and read_ext != ".ods" :
830
821
request .node .add_marker (
831
822
pytest .mark .xfail (reason = "Maybe not supported by calamine" )
832
823
)
@@ -852,10 +843,10 @@ def test_sheet_name(self, request, read_ext, engine, df_ref):
852
843
reason = "Sheets containing datetimes not supported by pyxlsb"
853
844
)
854
845
)
855
- if engine == "calamine" and read_ext in {".xls" , ".xlsb" , ".ods" }:
846
+ if engine == "calamine" and read_ext in {".xls" , ".xlsb" }:
856
847
request .node .add_marker (
857
848
pytest .mark .xfail (
858
- reason = "Calamine support parsing datetime only in xlsx"
849
+ reason = "Calamine support parsing datetime only in xlsx/ods "
859
850
)
860
851
)
861
852
@@ -1027,10 +1018,10 @@ def test_reader_seconds(self, request, engine, read_ext):
1027
1018
reason = "Sheets containing datetimes not supported by pyxlsb"
1028
1019
)
1029
1020
)
1030
- if engine == "calamine" and read_ext in {".xls" , ".xlsb" , ".ods" }:
1021
+ if engine == "calamine" and read_ext in {".xls" , ".xlsb" }:
1031
1022
request .node .add_marker (
1032
1023
pytest .mark .xfail (
1033
- reason = "Calamine support parsing datetime only in xlsx"
1024
+ reason = "Calamine support parsing datetime only in xlsx/ods "
1034
1025
)
1035
1026
)
1036
1027
if engine == "calamine" :
@@ -1073,12 +1064,16 @@ def test_read_excel_multiindex(self, request, engine, read_ext):
1073
1064
reason = "Sheets containing datetimes not supported by pyxlsb"
1074
1065
)
1075
1066
)
1076
- if engine == "calamine" and read_ext in {".xls" , ".xlsb" , ".ods" }:
1067
+ if engine == "calamine" and read_ext in {".xls" , ".xlsb" }:
1077
1068
request .node .add_marker (
1078
1069
pytest .mark .xfail (
1079
- reason = "Calamine support parsing datetime only in xlsx"
1070
+ reason = "Calamine support parsing datetime only in xlsx/ods "
1080
1071
)
1081
1072
)
1073
+ if engine == "calamine" and read_ext == ".ods" :
1074
+ request .node .add_marker (
1075
+ pytest .mark .xfail (reason = "Last test fails in calamine" )
1076
+ )
1082
1077
1083
1078
mi = MultiIndex .from_product ([["foo" , "bar" ], ["a" , "b" ]])
1084
1079
mi_file = "testmultiindex" + read_ext
@@ -1175,10 +1170,10 @@ def test_read_excel_multiindex_blank_after_name(
1175
1170
f"not supported by { engine } (GH4679)"
1176
1171
)
1177
1172
)
1178
- if engine == "calamine" and read_ext in {".xls" , ".xlsb" , ".ods" }:
1173
+ if engine == "calamine" and read_ext in {".xls" , ".xlsb" }:
1179
1174
request .node .add_marker (
1180
1175
pytest .mark .xfail (
1181
- reason = "Calamine support parsing datetime only in xlsx"
1176
+ reason = "Calamine support parsing datetime only in xlsx/ods "
1182
1177
)
1183
1178
)
1184
1179
@@ -1310,10 +1305,10 @@ def test_read_excel_skiprows(self, request, engine, read_ext):
1310
1305
reason = "Sheets containing datetimes not supported by pyxlsb"
1311
1306
)
1312
1307
)
1313
- if engine == "calamine" and read_ext in {".xls" , ".xlsb" , ".ods" }:
1308
+ if engine == "calamine" and read_ext in {".xls" , ".xlsb" }:
1314
1309
request .node .add_marker (
1315
1310
pytest .mark .xfail (
1316
- reason = "Calamine support parsing datetime only in xlsx"
1311
+ reason = "Calamine support parsing datetime only in xlsx/ods "
1317
1312
)
1318
1313
)
1319
1314
@@ -1371,10 +1366,10 @@ def test_read_excel_skiprows_callable_not_in(self, request, engine, read_ext):
1371
1366
reason = "Sheets containing datetimes not supported by pyxlsb"
1372
1367
)
1373
1368
)
1374
- if engine == "calamine" and read_ext in {".xls" , ".xlsb" , ".ods" }:
1369
+ if engine == "calamine" and read_ext in {".xls" , ".xlsb" }:
1375
1370
request .node .add_marker (
1376
1371
pytest .mark .xfail (
1377
- reason = "Calamine support parsing datetime only in xlsx"
1372
+ reason = "Calamine support parsing datetime only in xlsx/ods "
1378
1373
)
1379
1374
)
1380
1375
@@ -1651,10 +1646,10 @@ def test_excel_table_sheet_by_index(self, request, engine, read_ext, df_ref):
1651
1646
reason = "Sheets containing datetimes not supported by pyxlsb"
1652
1647
)
1653
1648
)
1654
- if engine == "calamine" and read_ext in {".xls" , ".xlsb" , ".ods" }:
1649
+ if engine == "calamine" and read_ext in {".xls" , ".xlsb" }:
1655
1650
request .node .add_marker (
1656
1651
pytest .mark .xfail (
1657
- reason = "Calamine support parsing datetime only in xlsx"
1652
+ reason = "Calamine support parsing datetime only in xlsx/ods "
1658
1653
)
1659
1654
)
1660
1655
@@ -1686,10 +1681,10 @@ def test_sheet_name(self, request, engine, read_ext, df_ref):
1686
1681
reason = "Sheets containing datetimes not supported by pyxlsb"
1687
1682
)
1688
1683
)
1689
- if engine == "calamine" and read_ext in {".xls" , ".xlsb" , ".ods" }:
1684
+ if engine == "calamine" and read_ext in {".xls" , ".xlsb" }:
1690
1685
request .node .add_marker (
1691
1686
pytest .mark .xfail (
1692
- reason = "Calamine support parsing datetime only in xlsx"
1687
+ reason = "Calamine support parsing datetime only in xlsx/ods "
1693
1688
)
1694
1689
)
1695
1690
@@ -1784,10 +1779,10 @@ def test_read_datetime_multiindex(self, request, engine, read_ext):
1784
1779
reason = "Sheets containing datetimes not supported by pyxlsb"
1785
1780
)
1786
1781
)
1787
- if engine == "calamine" and read_ext in {".xls" , ".xlsb" , ".ods" }:
1782
+ if engine == "calamine" and read_ext in {".xls" , ".xlsb" }:
1788
1783
request .node .add_marker (
1789
1784
pytest .mark .xfail (
1790
- reason = "Calamine support parsing datetime only in xlsx"
1785
+ reason = "Calamine support parsing datetime only in xlsx/ods "
1791
1786
)
1792
1787
)
1793
1788
0 commit comments