Skip to content

feat: a missing column names the dataset's real columns - #11

Merged
debabsah merged 1 commit into
mainfrom
feat/column-suggestions
Oct 3, 2026
Merged

debabsah merged 1 commit into
mainfrom
feat/column-suggestions

Conversation

@debabsah

@debabsah debabsah commented Oct 3, 2026

Copy link
Copy Markdown
Owner

Item B from the 0.2.0 triage.

Before: groupby 'Region' not on dataset 'orders' (has 23 columns). An agent or a person had to look the dataset up in Superset to find the right name.

After: groupby 'Region' not on dataset 'orders'; did you mean 'region'? Columns: order_id, ordered_at, region, amount, status, and the JSON error carries "candidates": ["region"].

  • Up to three suggestions: a case-only difference first, then close spellings (difflib, ignoring case).
  • The dataset's columns are listed, capped at 50, then "and N more".
  • Covers plain column fields, the column inside an aggregate (SUM(amont)), and chart and filter-bar filter columns.
  • candidates is a new field on every resolution error (empty except for column_not_found); existing fields are unchanged.
  • The MCP tools use the same resolver, so check_spec and build_dashboard return the same.

Tests: seven offline cases in tests/test_column_suggestions.py; tools/ci_live_check.py now resolves a deliberately misspelled column against real Superset 4.1.4, 5.0.0 and 6.1.0 and requires the real column as the first suggestion.

The guides in #9 that say the error gives a count will be updated there.

Offline suite: 354 passed.

The column_not_found error gave only the dataset's column count. It now
suggests up to three close matches (a case-only difference first, then by
spelling) and lists the columns, capped at 50. The suggestions are also in
a new `candidates` field on the JSON error, so an agent can correct the
spec without parsing the message; the MCP tools share the resolver.

Tests: seven offline cases, and the live check now resolves a deliberately
misspelled column on 4.1.4, 5.0.0 and 6.1.0 and requires the real one as
the first suggestion.
@debabsah
debabsah merged commit c6a3079 into main Oct 3, 2026
7 checks passed
@debabsah
debabsah deleted the feat/column-suggestions branch October 3, 2026 21:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant