Skip to content

Commit a6d5825

Browse files
Mikecruzzoe
Mike
authored andcommitted
Fixes based on review
1 parent af0a535 commit a6d5825

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

pandas/io/excel/_base.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -808,9 +808,9 @@ def __init__(self, io, engine=None):
808808
if engine == "xlrd" or engine is None:
809809
engine = "xlrd"
810810
warnings.warn(
811-
"xlrd is deprecated. Maintained engines: 'openpyxl' or 'odf'.",
811+
'The Excel reader engine will default to "openpyxl" in the future. \
812+
Specify engine="openpyxl" to suppress this warning.',
812813
FutureWarning,
813-
stacklevel=2,
814814
)
815815
if engine not in self._engines:
816816
raise ValueError("Unknown engine: {engine}".format(engine=engine))

pandas/tests/io/excel/test_xlrd.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,17 +41,15 @@ def test_excel_table_sheet_by_index(datapath, read_ext):
4141
pd.read_excel(excel, "asdf")
4242

4343

44+
# See issue #29375
4445
def test_excel_file_warning_with_default_engine(datapath):
4546
path = datapath("io", "data", "test1.xls")
46-
with tm.assert_produces_warning(
47-
FutureWarning, check_stacklevel=False, raise_on_extra_warnings=False
48-
):
47+
with tm.assert_produces_warning(FutureWarning):
4948
pd.ExcelFile(path)
5049

5150

51+
# See issue #29375
5252
def test_read_excel_warning_with_default_engine(tmpdir, datapath):
5353
path = datapath("io", "data", "test1.xls")
54-
with tm.assert_produces_warning(
55-
FutureWarning, check_stacklevel=False, raise_on_extra_warnings=False
56-
):
54+
with tm.assert_produces_warning(FutureWarning):
5755
pd.read_excel(path, "Sheet1")

0 commit comments

Comments
 (0)