read_excel and ExcelFile engine conflict · Issue #26566 · pandas-dev/pandas (original) (raw)

Skip to content

Provide feedback

Saved searches

Use saved searches to filter your results more quickly

Sign up

@WillAyd

Description

@WillAyd

This is currently valid code:

xl = pd.ExcelFile('foo.xlsx', engine='xlrd') pd.read_excel(xl, engine='openpyxl') Empty DataFrame Columns: [] Index: []

Though ambiguous as to which engine is actually being used. I think we should be raising if an engine is specified in read_excel when the target is a pd.ExcelFile, as the latter is a lower level construct and will already have an engine in place.

@simonjayhawkins