Skip to content

Commit 6bb95ab

Browse files
Mikeroberthdevries
Mike
authored andcommitted
Fixes based on review
1 parent 17f6975 commit 6bb95ab

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

pandas/io/excel/_base.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -855,9 +855,9 @@ def __init__(self, path_or_buffer, engine=None):
855855

856856
if engine == "xlrd":
857857
warnings.warn(
858-
"xlrd is deprecated. Maintained engines: 'openpyxl' or 'odf'.",
858+
'The Excel reader engine will default to "openpyxl" in the future. \
859+
Specify engine="openpyxl" to suppress this warning.',
859860
FutureWarning,
860-
stacklevel=2,
861861
)
862862
if engine not in self._engines:
863863
raise ValueError(f"Unknown engine: {engine}")

pandas/tests/io/excel/test_xlrd.py

+4-6
Original file line numberDiff line numberDiff line change
@@ -43,17 +43,15 @@ def test_excel_table_sheet_by_index(datapath, read_ext):
4343
pd.read_excel(excel, sheet_name="asdf")
4444

4545

46+
# See issue #29375
4647
def test_excel_file_warning_with_default_engine(datapath):
4748
path = datapath("io", "data", "test1.xls")
48-
with tm.assert_produces_warning(
49-
FutureWarning, check_stacklevel=False, raise_on_extra_warnings=False
50-
):
49+
with tm.assert_produces_warning(FutureWarning):
5150
pd.ExcelFile(path)
5251

5352

53+
# See issue #29375
5454
def test_read_excel_warning_with_default_engine(tmpdir, datapath):
5555
path = datapath("io", "data", "test1.xls")
56-
with tm.assert_produces_warning(
57-
FutureWarning, check_stacklevel=False, raise_on_extra_warnings=False
58-
):
56+
with tm.assert_produces_warning(FutureWarning):
5957
pd.read_excel(path, sheet_name="Sheet1")

0 commit comments

Comments
 (0)