Skip to content

fix(adapters): enforce structured unsupported-operation behavior - #36

Merged
wolfiesch merged 4 commits into
masterfrom
codex/2026-05-08-08-30-44-audit-and-update-adapter-methods-and-policies
May 8, 2026
Merged

fix(adapters): enforce structured unsupported-operation behavior#36
wolfiesch merged 4 commits into
masterfrom
codex/2026-05-08-08-30-44-audit-and-update-adapter-methods-and-policies

Conversation

@wolfiesch

Copy link
Copy Markdown
Collaborator

Motivation

  • Several lightweight adapters used silent no-ops (pass) for unsupported read/write surfaces which made capability gaps indistinguishable from semantic regressions.
  • The harness and reporters need a single, structured signal so unsupported features are classified as capability gaps (warning) rather than errors.

Description

  • Add a structured exception UnsupportedAdapterOperationError and a helper ExcelAdapter.unsupported_operation(...) for adapters to raise when a feature is not implemented.
  • Replace silent no-ops in lightweight adapters so unsupported write/read surfaces now call self.unsupported_operation(...) in src/excelbench/harness/adapters/pyexcel_adapter.py, pylightxl_adapter.py, and xlwt_adapter.py.
  • Update failure explanation rendering in src/excelbench/results/failure_explainer.py to explicitly render DiagnosticCategory.UNSUPPORTED_FEATURE as an unsupported-capability explanation (not a semantic regression).
  • Add/adjust tests to assert the new behavior in tests/test_adapter_base.py, tests/test_lightweight_adapters.py, and tests/test_adapters.py, and add a short contributor note in CONTRIBUTING.md requiring adapters to raise UnsupportedAdapterOperationError for unsupported surfaces.

Testing

  • Ran targeted linter checks with uv run ruff check against the modified files and fixed style issues; the targeted ruff run passed.
  • Attempted to run the adapter-focused tests with uv run pytest -o addopts='' tests/test_adapter_base.py tests/test_lightweight_adapters.py tests/test_adapters.py, but collection failed in this environment due to a missing optional dependency (xlwings) required by other import-time modules; the tests and harness-level collection succeed in a full dev environment with the standard extras installed.
  • Ran mypy in this environment and observed existing repo-wide/stub-related failures (unrelated to these changes) due to missing stubs/dependencies; these are pre-existing baseline issues and were not introduced by this patch.

Codex Task

Copilot AI review requested due to automatic review settings May 8, 2026 08:30

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR standardizes how adapters signal unsupported feature surfaces by introducing a structured UnsupportedAdapterOperationError and updating lightweight adapters/tests/reporting so capability gaps are classified as “unsupported” rather than indistinguishable silent no-ops.

Changes:

  • Add UnsupportedAdapterOperationError plus ExcelAdapter.unsupported_operation(...) to raise structured unsupported-operation failures.
  • Replace silent pass no-ops with self.unsupported_operation(...) in pyexcel/pylightxl/xlwt adapters.
  • Update failure explanation rendering and tests/docs to recognize and enforce unsupported-feature signaling.

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
src/excelbench/harness/adapters/base.py Introduces structured unsupported-operation exception + helper raiser and maps unsupported to UNSUPPORTED_FEATURE.
src/excelbench/harness/adapters/pyexcel_adapter.py Replaces unsupported write-surface no-ops with structured unsupported-operation raises.
src/excelbench/harness/adapters/pylightxl_adapter.py Replaces unsupported write-surface no-ops with structured unsupported-operation raises.
src/excelbench/harness/adapters/xlwt_adapter.py Replaces unsupported tier-2 write-surface no-ops with structured unsupported-operation raises.
src/excelbench/results/failure_explainer.py Adds explicit rendering for DiagnosticCategory.UNSUPPORTED_FEATURE.
tests/test_adapter_base.py Adds coverage that unsupported_operation() maps to UNSUPPORTED_FEATURE.
tests/test_lightweight_adapters.py Updates Pyexcel tests to expect raises; adds Pylightxl unsupported-write assertions.
tests/test_adapters.py Adds Xlwt unsupported-operation assertion; adds Calamine close-workbook test.
CONTRIBUTING.md Documents requirement to raise UnsupportedAdapterOperationError via unsupported_operation().

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/excelbench/harness/adapters/base.py
Comment thread tests/test_lightweight_adapters.py Outdated
Comment thread tests/test_lightweight_adapters.py Outdated
Comment thread tests/test_adapters.py

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 571700fbcb

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/excelbench/harness/adapters/pyexcel_adapter.py
Comment thread src/excelbench/harness/adapters/pylightxl_adapter.py
@wolfiesch
wolfiesch merged commit a7ef0b8 into master May 8, 2026
5 checks passed
@wolfiesch
wolfiesch deleted the codex/2026-05-08-08-30-44-audit-and-update-adapter-methods-and-policies branch May 8, 2026 20:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants