Skip to content

read_excel and ExcelFile engine conflict #26566

Closed
@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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions