Skip to content

Future Warning: Passing bytes to read_excel is deprecated #4036

@EdwinWenink

Description

@EdwinWenink

Hi,

When using unstructured in a test, I get the following deprecation warning.

[redacted]/site-packages/unstructured/partition/xlsx.py:197: FutureWarning: Passing bytes to 'read_excel' is deprecated and will be removed in a future version. To read from a byte string, wrap it in a `BytesIO` object.
    return pd.read_excel(f, sheet_name=None, header=self.header_row_idx)

See:

return pd.read_excel(f, sheet_name=None, header=self.header_row_idx)

Deprecation is logged here: https://pandas.pydata.org/docs/dev/reference/api/pandas.read_excel.html

Fix should be simple: wrap f in an BytesIO object.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions