@@ -407,6 +407,11 @@ def test_excel_cell_error_na(self, request, engine, read_ext):
407
407
)
408
408
)
409
409
410
+ if engine == "calamine" and read_ext == ".ods" :
411
+ request .node .add_marker (
412
+ pytest .mark .xfail (reason = "Calamine can't extract error from ods files" )
413
+ )
414
+
410
415
parsed = pd .read_excel ("test3" + read_ext , sheet_name = "Sheet1" )
411
416
expected = DataFrame ([[np .nan ]], columns = ["Test" ])
412
417
tm .assert_frame_equal (parsed , expected )
@@ -572,11 +577,17 @@ def test_reader_dtype_str(self, read_ext, dtype, expected):
572
577
actual = pd .read_excel (basename + read_ext , dtype = dtype )
573
578
tm .assert_frame_equal (actual , expected )
574
579
575
- def test_dtype_backend (self , read_ext , dtype_backend ):
580
+ def test_dtype_backend (self , request , engine , read_ext , dtype_backend ):
576
581
# GH#36712
577
582
if read_ext in (".xlsb" , ".xls" ):
578
583
pytest .skip (f"No engine for filetype: '{ read_ext } '" )
579
584
585
+ # GH 54994
586
+ if engine == "calamine" and read_ext == ".ods" :
587
+ request .node .add_marker (
588
+ pytest .mark .xfail (reason = "OdsWriter produces broken file" )
589
+ )
590
+
580
591
df = DataFrame (
581
592
{
582
593
"a" : Series ([1 , 3 ], dtype = "Int64" ),
@@ -617,11 +628,17 @@ def test_dtype_backend(self, read_ext, dtype_backend):
617
628
expected = df
618
629
tm .assert_frame_equal (result , expected )
619
630
620
- def test_dtype_backend_and_dtype (self , read_ext ):
631
+ def test_dtype_backend_and_dtype (self , request , engine , read_ext ):
621
632
# GH#36712
622
633
if read_ext in (".xlsb" , ".xls" ):
623
634
pytest .skip (f"No engine for filetype: '{ read_ext } '" )
624
635
636
+ # GH 54994
637
+ if engine == "calamine" and read_ext == ".ods" :
638
+ request .node .add_marker (
639
+ pytest .mark .xfail (reason = "OdsWriter produces broken file" )
640
+ )
641
+
625
642
df = DataFrame ({"a" : [np .nan , 1.0 ], "b" : [2.5 , np .nan ]})
626
643
with tm .ensure_clean (read_ext ) as file_path :
627
644
df .to_excel (file_path , sheet_name = "test" , index = False )
@@ -633,11 +650,17 @@ def test_dtype_backend_and_dtype(self, read_ext):
633
650
)
634
651
tm .assert_frame_equal (result , df )
635
652
636
- def test_dtype_backend_string (self , read_ext , string_storage ):
653
+ def test_dtype_backend_string (self , request , engine , read_ext , string_storage ):
637
654
# GH#36712
638
655
if read_ext in (".xlsb" , ".xls" ):
639
656
pytest .skip (f"No engine for filetype: '{ read_ext } '" )
640
657
658
+ # GH 54994
659
+ if engine == "calamine" and read_ext == ".ods" :
660
+ request .node .add_marker (
661
+ pytest .mark .xfail (reason = "OdsWriter produces broken file" )
662
+ )
663
+
641
664
pa = pytest .importorskip ("pyarrow" )
642
665
643
666
with pd .option_context ("mode.string_storage" , string_storage ):
@@ -975,6 +998,14 @@ def test_reader_seconds(self, request, engine, read_ext):
975
998
)
976
999
)
977
1000
1001
+ # GH 55045
1002
+ if engine == "calamine" and read_ext == ".ods" :
1003
+ request .node .add_marker (
1004
+ pytest .mark .xfail (
1005
+ reason = "ODS file contains bad datetime (seconds as text)"
1006
+ )
1007
+ )
1008
+
978
1009
# Test reading times with and without milliseconds. GH5945.
979
1010
expected = DataFrame .from_dict (
980
1011
{
@@ -1009,6 +1040,11 @@ def test_read_excel_multiindex(self, request, engine, read_ext):
1009
1040
)
1010
1041
)
1011
1042
1043
+ if engine == "calamine" and read_ext == ".ods" :
1044
+ request .node .add_marker (
1045
+ pytest .mark .xfail (reason = "Last test fails in calamine" )
1046
+ )
1047
+
1012
1048
mi = MultiIndex .from_product ([["foo" , "bar" ], ["a" , "b" ]])
1013
1049
mi_file = "testmultiindex" + read_ext
1014
1050
0 commit comments