Skip to content

refactor(mcp): dedupe list-tool schemas and delete dead middleware - #41923

Merged
aminghadersohi merged 7 commits into
apache:masterfrom
aminghadersohi:aminghadersohi/mcp-list-schema-dedup
Jul 22, 2026
Merged

refactor(mcp): dedupe list-tool schemas and delete dead middleware#41923
aminghadersohi merged 7 commits into
apache:masterfrom
aminghadersohi:aminghadersohi/mcp-list-schema-dedup

Conversation

@aminghadersohi

Copy link
Copy Markdown
Contributor

SUMMARY

First slice of a DRY cleanup pass over superset/mcp_service/. Two independent, non-breaking changes:

  1. Shared list-tool schema base. Every list_* tool's request/response schema pair re-declared the same 7 filter/pagination fields, the same 2 field validators, and the same 13-field response envelope (tag/schemas.py and query/schemas.py were verbatim duplicates modulo naming). Introduces PaginatedListRequest/PaginatedResponse generic base models in common/pagination_schemas.py and migrates the 15 list schema pairs onto them: chart, dashboard, database, dataset, report, query, rls, role, saved_query, tag, task, theme, user, and annotation_layer (both list_annotation_layers and list_layer_annotations).

    semantic_layer/list_metrics is intentionally not migrated — its request/response shape already diverges from the shared envelope (no filters/select_columns/order_direction, a different response envelope entirely), so folding it in would be a behavior change rather than a pure dedup. Left as-is for separate follow-up work.

    Wire format is unchanged. dataset's ListDatasetsRequest is the one domain that doesn't parse JSON-string filters/select_columns (unlike its 14 siblings) — that's intentional per an existing test (test_list_datasets_with_string_filters) that asserts a ValidationError for string input, so the base validators are explicitly overridden as no-ops there to preserve that behavior exactly.

  2. Delete dead infrastructure (~800 lines). build_middleware_list() in server.py only wires StructuredContentStripperMiddleware, RBACToolVisibilityMiddleware, LoggingMiddleware, and GlobalErrorHandlerMiddleware. Three middleware classes were never registered anywhere and have zero test coverage: FieldPermissionsMiddleware (which fails open on error — "Return original response if filtering fails"), PrivateToolMiddleware, and RateLimitMiddleware (plus its InMemoryRateLimiter/RedisRateLimiter backends). Deletes all three, along with the utils/permissions_utils.py helpers that existed solely to serve FieldPermissionsMiddleware (kept get_current_user, which is used by mcp_core.py). Checked git history for any in-progress work wiring up rate limiting before deleting — found none; happy to hold this off if that's incorrect.

    Also deletes three small dead-code items: SORTABLE_CHART_COLUMNS (list_charts.py, unreferenced), ALL_SAVED_QUERY_COLUMNS (saved_query/schemas.py, unreferenced), and an unreachable isinstance(request.config, dict) branch in generate_chart.py (request.config is always a validated ChartConfig, never a dict).

Net: -2,112 lines (308 insertions, 2,420 deletions) across 20 files.

BEFORE/AFTER

No behavior or API change — this is a structural refactor. Request/response JSON shape, defaults, and validation error messages are identical to before.

TESTING INSTRUCTIONS

  1. pytest tests/unit_tests/mcp_service/ — full suite (2,663 tests) passes unmodified except for the removal of test_permissions_utils.py, which tested only the deleted dead-code helpers.
  2. pre-commit run --files <changed files> — mypy, ruff, ruff-format, pylint all pass.

ADDITIONAL INFORMATION

Follow-up work identified but intentionally out of scope for this PR:

  • List/get tool factory to absorb the remaining ~80-120 lines of per-tool wrapper boilerplate.
  • Unified error_type enum + single error model on MCPBaseError (currently ~100 free-form error_type strings across 4 incompatible error-response shapes).
  • Call-time enforcement of @requires_data_model_metadata_access in mcp_auth_hook (currently ~20 tools repeat an inline guard).
  • Dedupe mcp_auth_hook's sync/async bodies (currently duplicated, with a subtle behavioral divergence around _remove_session_safe()).

@codecov

codecov Bot commented Jul 10, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 90.99099% with 10 lines in your changes missing coverage. Please review.
✅ Project coverage is 65.28%. Comparing base (8296fe8) to head (2795074).

Files with missing lines Patch % Lines
superset/mcp_service/common/pagination_schemas.py 89.36% 4 Missing and 1 partial ⚠️
superset/mcp_service/dataset/schemas.py 81.81% 2 Missing ⚠️
superset/mcp_service/middleware.py 0.00% 2 Missing ⚠️
superset/mcp_service/chart/tool/generate_chart.py 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master   #41923      +/-   ##
==========================================
+ Coverage   65.27%   65.28%   +0.01%     
==========================================
  Files        2769     2769              
  Lines      156339   155552     -787     
  Branches    35787    35716      -71     
==========================================
- Hits       102047   101551     -496     
+ Misses      52325    52047     -278     
+ Partials     1967     1954      -13     
Flag Coverage Δ
hive 38.47% <90.99%> (-0.20%) ⬇️
mysql 57.91% <90.99%> (-0.01%) ⬇️
postgres 57.97% <90.99%> (-0.01%) ⬇️
presto 40.42% <90.99%> (-0.18%) ⬇️
python 59.39% <90.99%> (+0.01%) ⬆️
sqlite 57.57% <90.99%> (-0.01%) ⬇️
unit 100.00% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@aminghadersohi
aminghadersohi marked this pull request as ready for review July 10, 2026 20:34
@aminghadersohi
aminghadersohi requested a review from Copilot July 10, 2026 20:34
@dosubot dosubot Bot added the risk:refactor High risk as it involves large refactoring work label Jul 10, 2026

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 performs a structural cleanup of superset/mcp_service/ by deduplicating the common request/response envelope used by MCP list_* tools and removing unused/dead MCP middleware and related helpers/tests.

Changes:

  • Introduces shared generic base schemas (PaginatedListRequest / PaginatedResponse) and migrates MCP list-tool schemas to use them.
  • Removes unused MCP middleware implementations (and related field-permissions utilities) that were not wired into the server pipeline.
  • Deletes a few unreferenced constants and an unreachable branch in chart generation error handling.

Reviewed changes

Copilot reviewed 20 out of 20 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
superset/mcp_service/common/pagination_schemas.py Adds shared generic list request/response base models and validators.
superset/mcp_service/{annotation_layer,dashboard,database,dataset,query,report,rls,role,saved_query,tag,task,theme,user}/schemas.py Migrates per-domain list request/response schemas onto the shared pagination bases.
superset/mcp_service/middleware.py Deletes dead/unused middleware (private tool gating, rate limiting, field permissions filtering).
superset/mcp_service/utils/permissions_utils.py Reduces module to get_current_user() after removing dead field-permissions helpers.
superset/mcp_service/chart/schemas.py Migrates chart list schemas onto the shared pagination bases.
superset/mcp_service/chart/tool/list_charts.py Removes an unreferenced sortable-columns constant.
superset/mcp_service/chart/tool/generate_chart.py Removes unreachable error-context extraction branch in exception handling (needs a small follow-up fix).
tests/unit_tests/mcp_service/utils/test_permissions_utils.py Deletes tests for removed dead-code permission helpers.

Comment thread superset/mcp_service/chart/tool/generate_chart.py Outdated
@bito-code-review

Copy link
Copy Markdown
Contributor

The comment is accurate. Setting chart_type to "unknown" is indeed problematic because it discards the specific type information provided by the ChartConfig discriminator, which is essential for generating a correct and useful error payload. Since ChartConfig variants are designed to be self-describing via the chart_type field, using a generic "unknown" value undermines the schema's purpose and contradicts the intent of maintaining context for error handling.

@bito-code-review bito-code-review Bot 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.

Code Review Agent Run #df3a26

Actionable Suggestions - 1
  • superset/mcp_service/chart/tool/generate_chart.py - 1
Additional Suggestions - 2
  • superset/mcp_service/annotation_layer/schemas.py - 1
    • Type parameter inconsistency in generic class · Line 105-105
      The type parameter `ColumnOperator` on `AnnotationList` is inconsistent with the request schema's `AnnotationFilter`. Since `PaginatedResponse` is used only for response serialization and the `filters_applied` field is populated by the tool code's own `combined_filters` list (typed `List[ColumnOperator]`), this has no runtime effect, but it misleads callers about the filter type in this domain. Use `AnnotationFilter` to match `ListLayerAnnotationsRequest`.
  • superset/mcp_service/utils/permissions_utils.py - 1
    • Catch specific exceptions instead of Exception · Line 31-31
      Catching generic `Exception` is too broad and can mask unexpected errors. Consider catching only the specific `ImportError` that might occur from the flask import, or remove the try-except entirely if not needed.
Filtered by Review Rules

Bito filtered these suggestions based on rules created automatically for your feedback. Manage rules.

  • superset/mcp_service/user/schemas.py - 2
  • superset/mcp_service/task/schemas.py - 1
Review Details
  • Files reviewed - 20 · Commit Range: 33034c4..33034c4
    • superset/mcp_service/annotation_layer/schemas.py
    • superset/mcp_service/chart/schemas.py
    • superset/mcp_service/chart/tool/generate_chart.py
    • superset/mcp_service/chart/tool/list_charts.py
    • superset/mcp_service/common/pagination_schemas.py
    • superset/mcp_service/dashboard/schemas.py
    • superset/mcp_service/database/schemas.py
    • superset/mcp_service/dataset/schemas.py
    • superset/mcp_service/middleware.py
    • superset/mcp_service/query/schemas.py
    • superset/mcp_service/report/schemas.py
    • superset/mcp_service/rls/schemas.py
    • superset/mcp_service/role/schemas.py
    • superset/mcp_service/saved_query/schemas.py
    • superset/mcp_service/tag/schemas.py
    • superset/mcp_service/task/schemas.py
    • superset/mcp_service/theme/schemas.py
    • superset/mcp_service/user/schemas.py
    • superset/mcp_service/utils/permissions_utils.py
    • tests/unit_tests/mcp_service/utils/test_permissions_utils.py
  • Files skipped - 0
  • Tools
    • MyPy (Static Code Analysis) - ✔︎ Successful
    • Astral Ruff (Static Code Analysis) - ✔︎ Successful
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful

Bito Usage Guide

Commands

Type the following command in the pull request comment and save the comment.

  • /review - Manually triggers a full AI review.

  • /pause - Pauses automatic reviews on this pull request.

  • /resume - Resumes automatic reviews.

  • /resolve - Marks all Bito-posted review comments as resolved.

  • /abort - Cancels all in-progress reviews.

Refer to the documentation for additional commands.

Configuration

This repository uses Superset You can customize the agent settings here or contact your Bito workspace admin at evan@preset.io.

Documentation & Help

AI Code Review powered by Bito Logo

Comment thread superset/mcp_service/chart/tool/generate_chart.py Outdated
Comment thread superset/mcp_service/chart/tool/generate_chart.py
Comment thread superset/mcp_service/chart/tool/generate_chart.py Outdated
@aminghadersohi
aminghadersohi force-pushed the aminghadersohi/mcp-list-schema-dedup branch from 24fbbc2 to 961030c Compare July 15, 2026 16:35
Comment thread superset/mcp_service/common/pagination_schemas.py Outdated
@bito-code-review

bito-code-review Bot commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Code Review Agent Run #f0a467

Actionable Suggestions - 0
Additional Suggestions - 3
  • superset/mcp_service/chart/tool/list_charts.py - 1
    • Orphaned standalone module-level assignment · Line 64-64
      Consider moving the module-level `_DEFAULT_LIST_CHARTS_REQUEST = ListChartsRequest()` into the `list_charts` function (e.g., inline with `request = request or ListChartsRequest()`) or relocating it to a context that better groups it with other module-level defaults.
  • superset/mcp_service/dataset/schemas.py - 1
    • Missing test for search/filters exclusion · Line 234-258
      The `validate_search_and_filters` model validator is inherited from `PaginatedListRequest` but there are no tests verifying it prevents `search` + `filters` together on `ListDatasetsRequest`. BITO.md rule [6262] requires tests to assert actual business logic behavior.
  • superset/mcp_service/theme/schemas.py - 1
    • Missing class docstring · Line 106-106
      Class `ThemeList` lacks a docstring. Adaptive rules 12147/12148 require all new classes to have documentation describing their purpose and behavior.
Filtered by Review Rules

Bito filtered these suggestions based on rules created automatically for your feedback. Manage rules.

  • superset/mcp_service/chart/schemas.py - 1
  • superset/mcp_service/middleware.py - 1
  • superset/mcp_service/annotation_layer/schemas.py - 1
Review Details
  • Files reviewed - 20 · Commit Range: 134e216..3d097b3
    • superset/mcp_service/annotation_layer/schemas.py
    • superset/mcp_service/chart/schemas.py
    • superset/mcp_service/chart/tool/generate_chart.py
    • superset/mcp_service/chart/tool/list_charts.py
    • superset/mcp_service/common/pagination_schemas.py
    • superset/mcp_service/dashboard/schemas.py
    • superset/mcp_service/database/schemas.py
    • superset/mcp_service/dataset/schemas.py
    • superset/mcp_service/middleware.py
    • superset/mcp_service/query/schemas.py
    • superset/mcp_service/report/schemas.py
    • superset/mcp_service/rls/schemas.py
    • superset/mcp_service/role/schemas.py
    • superset/mcp_service/saved_query/schemas.py
    • superset/mcp_service/tag/schemas.py
    • superset/mcp_service/task/schemas.py
    • superset/mcp_service/theme/schemas.py
    • superset/mcp_service/user/schemas.py
    • superset/mcp_service/utils/permissions_utils.py
    • tests/unit_tests/mcp_service/utils/test_permissions_utils.py
  • Files skipped - 0
  • Tools
    • MyPy (Static Code Analysis) - ✔︎ Successful
    • Astral Ruff (Static Code Analysis) - ✔︎ Successful
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful

Bito Usage Guide

Commands

Type the following command in the pull request comment and save the comment.

  • /review - Manually triggers a full AI review.

  • /pause - Pauses automatic reviews on this pull request.

  • /resume - Resumes automatic reviews.

  • /resolve - Marks all Bito-posted review comments as resolved.

  • /abort - Cancels all in-progress reviews.

Refer to the documentation for additional commands.

Configuration

This repository uses Superset You can customize the agent settings here or contact your Bito workspace admin at evan@preset.io.

Documentation & Help

AI Code Review powered by Bito Logo

Introduce PaginatedListRequest/PaginatedResponse generic base models in
common/pagination_schemas.py and migrate the 15 list-tool request/response
schema pairs (chart, dashboard, database, dataset, report, query, rls, role,
saved_query, tag, task, theme, user, annotation_layer x2) onto them, removing
~2,100 lines of copy-pasted filter/pagination boilerplate. Wire format is
unchanged; the existing unit test suite (2,663 tests) passes without
modification aside from removing tests for deleted dead code.

semantic_layer/list_metrics is intentionally excluded — its request/response
shape already diverges from the shared envelope (see audit §1.4) and fixing
that is separate follow-up work.

Also removes ~800 lines of dead infrastructure that was never wired into
build_middleware_list() in server.py: FieldPermissionsMiddleware (which fails
open on error), PrivateToolMiddleware, RateLimitMiddleware plus its
InMemoryRateLimiter/RedisRateLimiter backends, and the now-unused
utils/permissions_utils.py helpers that existed solely to serve
FieldPermissionsMiddleware (get_current_user is kept — it's used by
mcp_core.py). Checked git history for in-progress rate-limiting work before
deleting; found none.

Deletes three other small dead-code items: SORTABLE_CHART_COLUMNS
(list_charts.py, unused), ALL_SAVED_QUERY_COLUMNS (saved_query/schemas.py,
unused), and an unreachable isinstance(request.config, dict) branch in
generate_chart.py (request.config is always a validated ChartConfig, never a
dict).

Follow-ups (not in this PR): list/get tool factory to absorb per-tool
boilerplate, a unified error_type enum on MCPBaseError, call-time enforcement
of @requires_data_model_metadata_access in mcp_auth_hook, and deduping the
mcp_auth_hook sync/async bodies.
…chart error path

Addresses review feedback (copilot, bito, codeant) noting that
request.config is a validated ChartConfig whose variants all define
chart_type as a discriminator, so hardcoding "unknown" discarded
context that was actually available.
The list-schema-dedup refactor deleted the `Dict` import while leaving
one annotation referencing it, which raises NameError at module import
since middleware.py has no `from __future__ import annotations`.
…lters

Addresses review feedback noting the newly introduced local variable
lacked an explicit type hint.
@aminghadersohi
aminghadersohi force-pushed the aminghadersohi/mcp-list-schema-dedup branch from 2556804 to d608d20 Compare July 17, 2026 16:02
… search/filters test

Addresses two 2026-07-15 code-review-bot suggestions on #41923:
- annotation_layer/schemas.py: a bito "wrong generic type parameter" flag
  on AnnotationList(PaginatedResponse[ColumnOperator]) looked like a dedup
  regression (every other domain parametrizes with its own *Filter type),
  but list_layer_annotations prepends a synthetic "layer_id" ColumnOperator
  to filters_applied that AnnotationFilter's col Literal doesn't allow, so
  the loose ColumnOperator param is intentional. Added a comment to make
  that explicit for future readers.
- dataset/test_dataset_schemas.py: added the missing
  search+filters-mutual-exclusion test for ListDatasetsRequest, matching
  the existing per-domain tests on chart/theme/query/saved_query for the
  same PaginatedListRequest.validate_search_and_filters behavior.
@aminghadersohi

Copy link
Copy Markdown
Contributor Author

Follow-up on the 2026-07-15 Bito review run #f0a467 — addressing all 6 items (3 "Additional Suggestions" + 3 "Filtered by Review Rules"):

Fixed (pushed in 480a59b):

  • dataset/schemas.py — missing test for the search+filters mutual-exclusion validator on ListDatasetsRequest. Added test_list_datasets_search_and_filters_conflict_validation, mirroring the existing per-domain tests on chart/theme/query/saved_query.
  • annotation_layer/schemas.py:105 (AnnotationList(PaginatedResponse[ColumnOperator]), flagged as "wrong generic type parameter") — I initially agreed and changed this to PaginatedResponse[AnnotationFilter] to match every other domain's convention, but that broke 5 tests: list_layer_annotations prepends a synthetic ColumnOperator(col="layer_id", ...) scoping filter to filters_applied, and "layer_id" isn't in AnnotationFilter's col Literal (only "short_descr" is). Reverted to ColumnOperator and added a comment explaining why this one domain is a deliberate exception to the pattern.

No change needed:

  • list_charts.py:64 (_DEFAULT_LIST_CHARTS_REQUEST = ListChartsRequest() module-level default) — this is the established convention used identically across all 13 other list_* tools (list_dashboards.py, list_datasets.py, list_tags.py, etc.), predating this PR. Singling out list_charts for inlining would be inconsistent.
  • theme/schemas.py:106 (ThemeList missing a docstring) — none of the 14 *List(PaginatedResponse[...]) response classes across the MCP service have docstrings (ChartList, DashboardList, ReportList, etc.); the shape is documented on the shared PaginatedResponse base. Adding one only to ThemeList would be inconsistent with its siblings.
  • chart/schemas.py:683 ("missing runtime fields on response") — verified ChartList(PaginatedResponse[ChartFilter])'s effective field set (count, total_count, page, page_size, total_pages, has_previous, has_next, columns_requested/loaded/available, sortable_columns, filters_applied, pagination, timestamp) is identical to the pre-refactor ChartList(BaseModel) on master — nothing was dropped in the dedup.
  • middleware.py:400-419 (CWE-1109 stale documentation reference) — this is the PrivateToolMiddleware deletion; grepped the repo for any remaining reference to PrivateToolMiddleware or the "private" tool tag it enforced and found none outside of an unrelated docstring in server.py. The deletion is clean.

Re-verified: 0 unresolved review threads, 2,976 tests/unit_tests/mcp_service/ tests pass, pre-commit clean.

@bito-code-review

bito-code-review Bot commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Code Review Agent Run #99fffe

Actionable Suggestions - 0
Additional Suggestions - 3
  • superset/mcp_service/common/pagination_schemas.py - 1
    • Latent TypeVar unparameterization bug · Line 113-122
      The `parse_filters` validator at line 121 extracts the filter type via `get_args(cls.model_fields['filters'].annotation)[0]`. When the base class is used directly without parameterization, this returns the unbound TypeVar instead of a concrete filter class, causing a downstream `AttributeError: 'TypeVar' object has no attribute 'model_validate'` when `parse_json_or_model_list` tries to call `model_class.model_validate()`. All current usages are properly parameterized (e.g., `class ListTagsRequest(PaginatedListRequest[TagFilter])`), so this edge case is not triggered, but adding a guard would prevent cryptic runtime errors if someone mistakenly uses the base class directly.
  • superset/mcp_service/middleware.py - 2
    • Unused import removal - verification needed · Line 21-22
      Verify `Dict` and `Protocol` are truly unused in this file; if they are used in type hints, the import removal will cause NameError at runtime. A grep confirmation was performed but a thorough codebase scan is recommended.
    • Removed import verification - defaultdict · Line 21-21
      Confirm `defaultdict` from collections module is not used anywhere in the file; grep shows no usages but this should be cross-verified.
Filtered by Review Rules

Bito filtered these suggestions based on rules created automatically for your feedback. Manage rules.

  • superset/mcp_service/database/schemas.py - 1
Review Details
  • Files reviewed - 21 · Commit Range: 7a94ab5..4388950
    • superset/mcp_service/annotation_layer/schemas.py
    • superset/mcp_service/chart/schemas.py
    • superset/mcp_service/chart/tool/generate_chart.py
    • superset/mcp_service/chart/tool/list_charts.py
    • superset/mcp_service/common/pagination_schemas.py
    • superset/mcp_service/dashboard/schemas.py
    • superset/mcp_service/database/schemas.py
    • superset/mcp_service/dataset/schemas.py
    • superset/mcp_service/middleware.py
    • superset/mcp_service/query/schemas.py
    • superset/mcp_service/report/schemas.py
    • superset/mcp_service/rls/schemas.py
    • superset/mcp_service/role/schemas.py
    • superset/mcp_service/saved_query/schemas.py
    • superset/mcp_service/tag/schemas.py
    • superset/mcp_service/task/schemas.py
    • superset/mcp_service/theme/schemas.py
    • superset/mcp_service/user/schemas.py
    • superset/mcp_service/utils/permissions_utils.py
    • tests/unit_tests/mcp_service/dataset/test_dataset_schemas.py
    • tests/unit_tests/mcp_service/utils/test_permissions_utils.py
  • Files skipped - 0
  • Tools
    • MyPy (Static Code Analysis) - ✔︎ Successful
    • Astral Ruff (Static Code Analysis) - ✔︎ Successful
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful

Bito Usage Guide

Commands

Type the following command in the pull request comment and save the comment.

  • /review - Manually triggers a full AI review.

  • /pause - Pauses automatic reviews on this pull request.

  • /resume - Resumes automatic reviews.

  • /resolve - Marks all Bito-posted review comments as resolved.

  • /abort - Cancels all in-progress reviews.

Refer to the documentation for additional commands.

Configuration

This repository uses Superset You can customize the agent settings here or contact your Bito workspace admin at evan@preset.io.

Documentation & Help

AI Code Review powered by Bito Logo

Comment thread tests/unit_tests/mcp_service/dataset/test_dataset_schemas.py

@rusackas rusackas left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nice cleanup. That's a lot of copy-pasted pagination/filter boilerplate collapsed into one generic base, and the description does the legwork of explaining what's intentionally excluded (list_metrics, the dataset string-filter override) rather than making me go dig for it. Also good to see the dead middleware actually confirmed dead (checked for in-progress rate-limiting work before deleting) instead of just assumed.

CI's green across the board. The only open thread is codeant flagging the dataset conflict-validation test for asserting ValueError instead of ValidationError. That one's wrong though, pydantic's ValidationError subclasses ValueError in v2, so pytest.raises(ValueError, ...) catches it fine and the test does pass. Not blocking anything.

Good history of applying the real bot feedback (chart_type, the missing type hint) and pushing back with an actual explanation on the one that wasn't (the AnnotationList ColumnOperator parametrization). Approving.

@aminghadersohi
aminghadersohi merged commit 1c0f259 into apache:master Jul 22, 2026
59 checks passed
niteshpurohit added a commit to HiMamaInc/superset that referenced this pull request Jul 24, 2026
* refactor(mcp): dedupe list-tool schemas and delete dead middleware (apache#41923)

* fix(ag-grid-table): respect row limit with server pagination (apache#41346)

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>

* feat(table/pivot-table): correct non-additive totals/subtotals via DB rollup [SIP-216] (apache#41184)

Co-authored-by: Superset Dev <dev@superset.apache.org>
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Co-authored-by: Amin Ghadersohi <amin.ghadersohi@gmail.com>

* feat(datasets): add RLS filter indicator badge to dataset list and explore view (apache#38807)

Co-authored-by: Evan <evan@preset.io>

* fix(chart): updates counties of kenya map (apache#38019)

Co-authored-by: Zack Adams <zack@Zacks-Laptop.local>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-authored-by: Evan <evan@preset.io>
Co-authored-by: Evan Rusackas <evan@rusackas.com>

* chore(deps): bump actions/setup-go from 6.5.0 to 7.0.0 (apache#42303)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps): bump nanoid from 5.0.9 to 6.0.0 in /superset-frontend (apache#42230)

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: hainenber <dotronghai96@gmail.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: hainenber <dotronghai96@gmail.com>
Co-authored-by: Joe Li <joe@preset.io>
Co-authored-by: Evan <evan@preset.io>
Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>

* test(dashboard): migrate dashboard load smoke test to Playwright (apache#41432)

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* fix(superset_app_root): when used with oauth (apache#38033)

Signed-off-by: Grégoire Bellon-Gervais <gregoire.bellon-gervais@docaposte.fr>
Co-authored-by: Evan Rusackas <evan@preset.io>
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>

* refactor: engine enforce SQLAlchemy 2.0 (apache#42277)

* fix(ag-grid-table): avoid ambiguous build query import (apache#42313)

* fix: Revert "chore(deps): bump echarts from 5.6.0 to 6.1.0 in /superset-frontend" (apache#42314)

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>

* adding circleci config

* fix(plugin-chart-echarts): import the -obj locale build so time axes render (apache#42317)

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>

* fix(pandas_postprocessing): avoid FutureWarning for max/min in boxplot MINMAX (apache#42272)

* fix(heatmap): correct tooltip axis value lookup and percentage calculations and add tests (apache#41864)

Signed-off-by: yousoph <sophieyou12@gmail.com>
Co-authored-by: Kamil Gabryjelski <kamil.gabryjelski@gmail.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>

* fix(forecast): resolve time grain robustly for Prophet forecasting (apache#42145)

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>

* fix: Added PostgreSQL 17.X to the supported database versions table in (apache#42280)

* fix(helm): add MCP HTTPRoute configuration (apache#42219)

* fix(dashboard): offer Exit edit mode when there is nothing to discard (apache#42208)

Co-authored-by: Claude Code <noreply@anthropic.com>

* chore(deps): bump actions/labeler from 6.2.0 to 7.0.0 (apache#42332)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps): bump github/codeql-action/analyze from 4.37.0 to 4.37.1 (apache#42331)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps): bump github/codeql-action/init from 4.37.0 to 4.37.1 (apache#42334)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps-dev): bump @formatjs/intl-durationformat from 0.10.17 to 0.10.18 in /superset-frontend (apache#42337)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps): bump caniuse-lite from 1.0.30001805 to 1.0.30001806 in /docs (apache#42333)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps): bump echarts to 6.1.0 with locale and containLabel guards (apache#42315) (apache#42321)

Co-authored-by: Claude Code <noreply@anthropic.com>
Co-authored-by: Amin Ghadersohi <amin.ghadersohi@gmail.com>

* docs: add pattern to the list of organisations using superset (apache#42341)

* chore(deps): bump ag-grid from 36.0.0 to 36.0.1 in /superset-frontend (apache#42338)

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: hainenber <dotronghai96@gmail.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: hainenber <dotronghai96@gmail.com>

* fix(mcp): trust dataset is_dttm flag when applying time_grain to VARCHAR temporal columns (apache#42288)

* chore(deps-dev): update taos-ws-py requirement from >=0.6.9 to >=0.7.0 (apache#42344)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps-dev): bump the storybook group in /superset-frontend with 5 updates (apache#42355)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* fix(native-filters): keep filter value input caret at inline start (apache#42323)

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>

* fix(mcp): truncate query-tool responses instead of hard-failing (apache#42244)

* chore(deps): bump nh3 from 0.3.5 to 0.3.6 (apache#42349)

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Joe Li <joe@preset.io>

* chore(deps): bump pydantic from 2.11.7 to 2.13.4 (apache#42350)

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Joe Li <joe@preset.io>

* chore(deps): bump sqlalchemy-continuum from 1.6.0 to 1.7.0 (apache#42351)

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Joe Li <joe@preset.io>

* fix(embedded): stop rejecting guest chart data built from control-specific params keys (apache#42295)

Co-authored-by: Claude Code <noreply@anthropic.com>

* fix(explore): show the beginning date on time-series x-axis line charts (apache#42046)

* fix(api): add example to get_export_ids_schema so Swagger "Try it out" pre-fills a valid array (apache#42265)

* chore: SQLAlchemy User cascade backref warnings are irrelevant (apache#42360)

* fix(charts): handle async (202) chart-data responses in StatefulChart (apache#42157)

Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
Co-authored-by: Evan Rusackas <evan@preset.io>

* feat(KustoKQL): Add support for NULL / IS NOT NULL operator (apache#37890)

Co-authored-by: ag-ramachandran <ramacg@microsoft.com>
Co-authored-by: Joe Li <joe@preset.io>

* chore(deps): bump pillow from 12.2.0 to 12.3.0 (apache#42348)

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Joe Li <joe@preset.io>

* chore(deps): bump flask-compress from 1.17 to 1.24 (apache#42346)

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Joe Li <joe@preset.io>

* chore(deps-dev): bump databricks-sql-connector from 4.2.6 to 4.3.0 (apache#42347)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Joe Li <joe@preset.io>
Co-authored-by: Evan Rusackas <evan@preset.io>

* fix(native-filters): use FILTER_STATE_CACHE_CONFIG timeout for dynamic filter option queries (apache#38910)

* fix(explore): render Jinja before validating legacy chart filters (apache#41996)

* fix(dataset): disable duplicate button when name is empty (apache#42217)

Co-authored-by: AS-MAC-1123 <as-mac-1123@AS-MAC-1123.local>
Co-authored-by: Evan Rusackas <evan@rusackas.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>

* docs(gunicorn): correct dead links in values.yaml (apache#42385)

* chore(deps): bump @deck.gl/mapbox from 9.3.6 to 9.3.7 in /superset-frontend in the deckgl group (apache#42377)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps): bump actions/checkout from 7.0.0 to 7.0.1 (apache#42376)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps): bump immer from 11.1.11 to 11.1.15 in /superset-frontend (apache#42378)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps): bump body-parser from 1.20.5 to 1.20.6 in /docs (apache#42370)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps-dev): bump brace-expansion from 1.1.15 to 1.1.16 in /superset-embedded-sdk (apache#42369)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* fix(security): bump pyasn1 from 0.6.3 to 0.6.4 (apache#42363)

* fix(security): bump pillow from 12.2.0 to 12.3.0 (apache#42362)

* docs(map-tiles): add Yandex Maps Tiles API configuration (apache#42375)

* ci: improve conditional checks for lillio tests and build

---------

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: hainenber <dotronghai96@gmail.com>
Signed-off-by: Grégoire Bellon-Gervais <gregoire.bellon-gervais@docaposte.fr>
Signed-off-by: yousoph <sophieyou12@gmail.com>
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Amin Ghadersohi <amin.ghadersohi@gmail.com>
Co-authored-by: Evan Rusackas <evan@preset.io>
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Co-authored-by: Superset Dev <dev@superset.apache.org>
Co-authored-by: SkinnyPigeon <e.blackledge@stuart.com>
Co-authored-by: Zack <adams.z.d@gmail.com>
Co-authored-by: Zack Adams <zack@Zacks-Laptop.local>
Co-authored-by: Evan Rusackas <evan@rusackas.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: hainenber <dotronghai96@gmail.com>
Co-authored-by: Joe Li <joe@preset.io>
Co-authored-by: Grégoire <greggbg@gmail.com>
Co-authored-by: Hans Yu <hans.yu@outlook.de>
Co-authored-by: Elizabeth Thompson <eschutho@gmail.com>
Co-authored-by: yousoph <sophieyou12@gmail.com>
Co-authored-by: Kamil Gabryjelski <kamil.gabryjelski@gmail.com>
Co-authored-by: Amitesh Gupta <143833521+singlaamitesh@users.noreply.github.com>
Co-authored-by: David <39565245+dmunozv04@users.noreply.github.com>
Co-authored-by: Yash Shrivastava <119301033+alephys26@users.noreply.github.com>
Co-authored-by: JUST.in DO IT <justin.park@airbnb.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: jesperct <jmilecelento@gmail.com>
Co-authored-by: Abdul Rehman <76230556+Abdulrehman-PIAIC80387@users.noreply.github.com>
Co-authored-by: jenwitteng <jenwit.amonpongitsara@agoda.com>
Co-authored-by: Ramachandran A G <106139410+ag-ramachandran@users.noreply.github.com>
Co-authored-by: ag-ramachandran <ramacg@microsoft.com>
Co-authored-by: Ujjwal Jain <jainujjwal1609@gmail.com>
Co-authored-by: Jean Massucatto <massucattoj@gmail.com>
Co-authored-by: suvankardas216 <rohanrohan510@gmail.com>
Co-authored-by: AS-MAC-1123 <as-mac-1123@AS-MAC-1123.local>
Co-authored-by: Alejandro Solares <219859296+ASolarers-Rodriguez@users.noreply.github.com>
Co-authored-by: ViktorGo86 <114023094+ViktorGo86@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk:refactor High risk as it involves large refactoring work size/XXL

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants