Skip to content

get_xlsx_sheet_info's unreadable-workbook path and the malformed @ENCODING skip are untested #1006

Closed

Description

@yakew7

Where: faircode/loaders_extra.py (get_xlsx_sheet_info() line 144, held_out_encoding_ignored_notes() lines 169-170), tests/test_loaders.py.

Current gap: get_xlsx_sheet_info() is meant to return None when a workbook cannot be opened or has no sheets, so the CLI and MCP notice stays silent and the real read error is reported instead; and held_out_encoding_ignored_notes() must skip a spec with a malformed @ENCODING suffix because the real parse reports it. Coverage shows neither branch runs, and a refactor that let these exceptions escape would turn a clean error into a traceback.

Repro:

$ python3 -m pytest tests -q -m "not slow" --cov=faircode --cov-report=term-missing | grep loaders_extra.py
faircode/loaders_extra.py ... 144, 169-170

Suggested approach: a corrupt .xlsx (a text file with that suffix) asserting None, and held_out_encoding_ignored_notes(["h.xlsx=race@"], "latin-1") asserting [] and no exception.

Activity

  1. added a commit that references this issue on Oct 16, 2026
  2. yakew7 commented on Oct 16, 2026

    @yakew7
    OwnerAuthor

    Fixed in 6df5e42 (on main). Full suite green (941 passed).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions