Unstructured-IO / Unstructured-IO/unstructured
Future Warning: Passing bytes to `read_excel` is deprecated
Open
Beginner friendly
Nobody has claimed this yet.
- Dominant language
- HTML
- Stars
- 15.5k
- Forks
- 1.3k
- Avg merge
- 4d 2h
- Merged PRs (30d)
- 13
Description
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)
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.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Inspect unstructured/partition/xlsx.py around line 197 and trace how f is passed to pandas.read_excel. Reproduce the XLSX partitioning warning in the relevant test, then verify the warning is gone while the parsed workbook behavior remains unchanged.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- pandas, python
- Domain
- data
- Issue type
- Bug
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 72/100