File tree 3 files changed +10
-1
lines changed
3 files changed +10
-1
lines changed Original file line number Diff line number Diff line change 382
382
- Bug in :func: `read_hdf ` closing stores that it didn't open when Exceptions are raised (:issue: `28699 `)
383
383
- Bug in :meth: `DataFrame.read_json ` where using ``orient="index" `` would not maintain the order (:issue: `28557 `)
384
384
- Bug in :meth: `DataFrame.to_html ` where the length of the ``formatters `` argument was not verified (:issue: `28469 `)
385
+ - Bug in :meth: `DataFrame.read_excel ` with ``engine='ods' `` when ``sheet_name `` argument references a non-existent sheet (:issue: `27676 `)
385
386
- Bug in :meth: `pandas.io.formats.style.Styler ` formatting for floating values not displaying decimals correctly (:issue: `13257 `)
386
387
- Bug in :meth: `DataFrame.to_html ` when using ``formatters=<list> `` and ``max_cols `` together. (:issue: `25955 `)
387
388
Original file line number Diff line number Diff line change @@ -61,7 +61,7 @@ def get_sheet_by_name(self, name: str):
61
61
if table .getAttribute ("name" ) == name :
62
62
return table
63
63
64
- raise ValueError ("sheet {name } not found" .format (name ))
64
+ raise ValueError ("sheet {} not found" .format (name ))
65
65
66
66
def get_sheet_data (self , sheet , convert_float : bool ) -> List [List [Scalar ]]:
67
67
"""Parse an ODF Table into a list of lists
Original file line number Diff line number Diff line change @@ -36,3 +36,11 @@ def test_read_writer_table():
36
36
result = pd .read_excel ("writertable.odt" , "Table1" , index_col = 0 )
37
37
38
38
tm .assert_frame_equal (result , expected )
39
+
40
+
41
+ def test_nonexistent_sheetname_raises (read_ext ):
42
+ # GH-27676
43
+ # Specifying a non-existent sheet_name parameter should throw an error
44
+ # with the sheet name.
45
+ with pytest .raises (ValueError , match = "sheet xyz not found" ):
46
+ pd .read_excel ("blank.ods" , sheet_name = "xyz" )
You can’t perform that action at this time.
0 commit comments