You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "mikebridge (via GitHub)" <gi...@apache.org> on 2026/09/14 21:48:36 UTC

[PR] fix(mcp): pre-validate metric/dimension compatibility in semantic-view get_table [superset]

mikebridge opened a new pull request, #44265:
URL: https://github.com/apache/superset/pull/44265

   ### SUMMARY
   
   Fixes SC-120964: `get_table` on a semantic view surfaced MetricFlow join-path failures — incompatible metric/dimension combinations (e.g. metric `orders` × dimension `product__product_name`) — as a generic `InternalError` *after* the query ran, giving the LLM nothing actionable.
   
   The view already exposes compatibility data (`SemanticView.get_compatible_dimensions`), so this validates before executing. On the external-view path, after name validation and before building/running the query, any requested dimension not in `view.get_compatible_dimensions(request.metrics, [])` is rejected with a structured `ValidationError` naming the incompatible dimension(s), the selected metric(s), and the view, and pointing at `get_compatible_dimensions` for valid combinations.
   
   Scope guards:
   - Built-in datasets have no metric/dimension compatibility constraint (all groupby columns are always compatible), so the gate is skipped for them.
   - Empty metric or dimension selections carry no join-path risk, so they skip the gate.
   - The execute path is unchanged: genuine backend/MetricFlow failures still surface as `InternalError`.
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   
   N/A — MCP tool behavior. Before: incompatible pair → `InternalError` after execution. After: `ValidationError` naming the pair, before execution.
   
   ### TESTING INSTRUCTIONS
   
   Unit (MCP tests require `fastmcp`; run where it is installed, e.g. the dev container):
   
   ```bash
   pytest tests/unit_tests/mcp_service/semantic_layer/tool/test_get_table.py -q   # 45 passed
   ```
   
   New cases: incompatible dimensions → structured `ValidationError` (exact message), `get_compatible_dimensions` consulted with `(metrics, [])`, and neither `_build_query_dict` nor `execute_tabular_query` is called; compatible selection → executes; a genuine backend failure (execute raises) → still `InternalError`; built-in datasets and empty metric/dimension selections → gate skipped, view compatibility never consulted.
   
   **Live call against a MetricFlow view is pending the demo core re-pin** (the harness runs core `89964b2a`, which is before this fix; superset-2's own stack lacks the `cube-local` provider extension so it can't resolve a semantic view). The end-to-end live verification is QA case **A12** in `superset-spec/semantic_layers/mcp-semantic-view-matrix-results.md` and will be exercised on the harness once this lands in the demo re-pin.
   
   ### ADDITIONAL INFORMATION
   
   - [x] Has associated issue: SC-120964
   - [ ] Required feature flags:
   - [ ] Changes UI
   - [ ] Includes DB Migration
   - [ ] Introduces new feature or API
   - [ ] Removes existing feature or API
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   
   https://claude.ai/code/session_01C7U5oFfrqUyM6hJTZiW2uf
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] fix(mcp): pre-validate metric/dimension compatibility in semantic-view get_table [superset]

Posted by "bito-code-review[bot] (via GitHub)" <gi...@apache.org>.
bito-code-review[bot] commented on PR #44265:
URL: https://github.com/apache/superset/pull/44265#issuecomment-5711202308

   AI Code Review is in progress (usually takes 3 to 15 minutes unless it's a very large PR).
   
   <details>
   <summary>
   Bito Usage Guide
   </summary>
   
   **Commands**
         
   Type the following command in the pull request comment and save the comment.
         
   - `/review` - Manually triggers an incremental AI Review.
   - `/review full` - 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 <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent/available-commands" target="_blank" rel="noopener noreferrer">documentation</a> for additional commands.
         
   **Configuration**
   
   This repository uses `Superset` You can customize the agent settings <a href="https://alpha.bito.ai/home/ai-agents/code-review-agent" target="_blank" rel="noopener noreferrer">here</a> or contact your Bito workspace admin at evan@preset.io.
         
   **Documentation & Help**
   - <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent/getting-started/install-run-using-bito-cloud/create-or-customize-an-agent-instance" target="_blank" rel="noopener noreferrer">Customize agent settings</a>
   - <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent/implementing-custom-code-review-rules" target="_blank" rel="noopener noreferrer">Review rules</a>
   - <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent" target="_blank" rel="noopener noreferrer">General documentation</a>
   - <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent/faqs" target="_blank" rel="noopener noreferrer">FAQ</a>
   
   </details>
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] fix(mcp): pre-validate metric/dimension compatibility in semantic-view get_table [superset]

Posted by "mikebridge (via GitHub)" <gi...@apache.org>.
mikebridge commented on code in PR #44265:
URL: https://github.com/apache/superset/pull/44265#discussion_r4041158952


##########
superset/mcp_service/semantic_layer/tool/get_table.py:
##########
@@ -322,6 +326,27 @@ async def _run_get_table_query(
             error_type="ValidationError",
         )
 
+    if (
+        not is_builtin
+        and resolved.view is not None
+        and request.metrics
+        and request.dimensions

Review Comment:
   Addressed in e57564e — `filters[].col` is now validated against the view's dimensions before compatibility is checked (same guard as metrics/dimensions).



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] fix(mcp): pre-validate metric/dimension compatibility in semantic-view get_table [superset]

Posted by "mikebridge (via GitHub)" <gi...@apache.org>.
mikebridge commented on code in PR #44265:
URL: https://github.com/apache/superset/pull/44265#discussion_r4043534992


##########
superset/mcp_service/semantic_layer/tool/get_table.py:
##########
@@ -322,6 +333,39 @@ async def _run_get_table_query(
             error_type="ValidationError",
         )
 
+    required_dimensions: set[str] = (
+        set(request.dimensions)
+        | {
+            query_filter.col
+            for query_filter in request.filters
+            if not (
+                query_filter.op == "TEMPORAL_RANGE"
+                and query_filter.col in resolved.temporal_columns

Review Comment:
   Addressed in 2daf0e449e571a59d0b0f96cc16cbd6fcbc7de80 — the exemption is keyed on metadata-confirmed temporal columns across grouping, filters, and ordering. Added accepted-axis/rejected-non-temporal regressions with discovery omitting the column. Thanks.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] fix(mcp): pre-validate metric/dimension compatibility in semantic-view get_table [superset]

Posted by "mikebridge (via GitHub)" <gi...@apache.org>.
mikebridge commented on code in PR #44265:
URL: https://github.com/apache/superset/pull/44265#discussion_r4042114602


##########
superset/mcp_service/semantic_layer/tool/get_table.py:
##########
@@ -322,6 +326,30 @@ async def _run_get_table_query(
             error_type="ValidationError",
         )
 
+    required_dimensions: set[str] = set(request.dimensions) | {
+        query_filter.col for query_filter in request.filters
+    }
+    if (
+        not is_builtin
+        and resolved.view is not None
+        and request.metrics
+        and required_dimensions
+    ):
+        compatible: set[str] = set(
+            resolved.view.get_compatible_dimensions(request.metrics, [])
+        )
+        incompatible: list[str] = sorted(required_dimensions - compatible)

Review Comment:
   Reproduced — an explicit TEMPORAL_RANGE on `order_ts` is rejected while `time_column` + `time_range` (same builder output) passes. Decision: exempt temporal-only filter columns from the compatibility guard so both spellings work; that keeps parity with get_chart_data, which delegates to shared query execution instead of this guard. Follow-up commit coming on this PR with a regression test for both forms. The order_by fix in 0c5f7f2f is independent of this.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] fix(mcp): pre-validate metric/dimension compatibility in semantic-view get_table [superset]

Posted by "mikebridge (via GitHub)" <gi...@apache.org>.
mikebridge commented on code in PR #44265:
URL: https://github.com/apache/superset/pull/44265#discussion_r4041219083


##########
superset/mcp_service/semantic_layer/tool/get_table.py:
##########
@@ -322,6 +326,30 @@ async def _run_get_table_query(
             error_type="ValidationError",
         )
 
+    required_dimensions: set[str] = set(request.dimensions) | {
+        query_filter.col for query_filter in request.filters
+    }

Review Comment:
   addressed in 0c5f7f2f93d7036a8fc6b76bec69ab221f3abda3



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] fix(mcp): pre-validate metric/dimension compatibility in semantic-view get_table [superset]

Posted by "bito-code-review[bot] (via GitHub)" <gi...@apache.org>.
bito-code-review[bot] commented on PR #44265:
URL: https://github.com/apache/superset/pull/44265#issuecomment-5737232222

   **Bito Automatic Review Skipped – PR Already Merged**<br/><br/>Bito scheduled an automatic review for this pull request, but the review was skipped because this PR was merged before the review could be run.<br/>No action is needed if you didn't intend to review it. To get a review, you can type `/review` in a comment and save it


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] fix(mcp): pre-validate metric/dimension compatibility in semantic-view get_table [superset]

Posted by "aminghadersohi (via GitHub)" <gi...@apache.org>.
aminghadersohi commented on code in PR #44265:
URL: https://github.com/apache/superset/pull/44265#discussion_r4015790697


##########
superset/mcp_service/semantic_layer/tool/get_table.py:
##########
@@ -322,6 +326,27 @@ async def _run_get_table_query(
             error_type="ValidationError",
         )
 
+    if (
+        not is_builtin
+        and resolved.view is not None
+        and request.metrics
+        and request.dimensions

Review Comment:
   `filters[].col` are dimension names too — validated against the same `valid_columns`, and the mapper binds them to provider `Dimension`s (`mapper.py:706-737`), so they need the same join. A filter on a dimension incompatible with `metrics` still fails downstream, unguarded. Design call, so no patch.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] fix(mcp): pre-validate metric/dimension compatibility in semantic-view get_table [superset]

Posted by "bito-code-review[bot] (via GitHub)" <gi...@apache.org>.
bito-code-review[bot] commented on PR #44265:
URL: https://github.com/apache/superset/pull/44265#issuecomment-5680511105

   <!-- Bito Reply -->
   The observation regarding `filters[].col` is correct. Since these columns are validated against `valid_columns` and mapped to provider `Dimension`s, they require the same join logic as other dimensions to ensure compatibility with metrics. Without this, filters on incompatible dimensions will indeed fail downstream without proper validation.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] fix(mcp): pre-validate metric/dimension compatibility in semantic-view get_table [superset]

Posted by "bito-code-review[bot] (via GitHub)" <gi...@apache.org>.
bito-code-review[bot] commented on PR #44265:
URL: https://github.com/apache/superset/pull/44265#issuecomment-5726083051

   AI Code Review is in progress (usually takes 3 to 15 minutes unless it's a very large PR).
   
   <details>
   <summary>
   Bito Usage Guide
   </summary>
   
   **Commands**
         
   Type the following command in the pull request comment and save the comment.
         
   - `/review` - Manually triggers an incremental AI Review.
   - `/review full` - 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 <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent/available-commands" target="_blank" rel="noopener noreferrer">documentation</a> for additional commands.
         
   **Configuration**
   
   This repository uses `Superset` You can customize the agent settings <a href="https://alpha.bito.ai/home/ai-agents/code-review-agent" target="_blank" rel="noopener noreferrer">here</a> or contact your Bito workspace admin at evan@preset.io.
         
   **Documentation & Help**
   - <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent/getting-started/install-run-using-bito-cloud/create-or-customize-an-agent-instance" target="_blank" rel="noopener noreferrer">Customize agent settings</a>
   - <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent/implementing-custom-code-review-rules" target="_blank" rel="noopener noreferrer">Review rules</a>
   - <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent" target="_blank" rel="noopener noreferrer">General documentation</a>
   - <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent/faqs" target="_blank" rel="noopener noreferrer">FAQ</a>
   
   </details>
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] fix(mcp): pre-validate metric/dimension compatibility in semantic-view get_table [superset]

Posted by "aminghadersohi (via GitHub)" <gi...@apache.org>.
aminghadersohi commented on code in PR #44265:
URL: https://github.com/apache/superset/pull/44265#discussion_r4042319861


##########
superset/mcp_service/semantic_layer/tool/get_table.py:
##########
@@ -322,6 +333,39 @@ async def _run_get_table_query(
             error_type="ValidationError",
         )
 
+    required_dimensions: set[str] = (
+        set(request.dimensions)
+        | {
+            query_filter.col
+            for query_filter in request.filters
+            if not (
+                query_filter.op == "TEMPORAL_RANGE"
+                and query_filter.col in resolved.temporal_columns

Review Comment:
   The exemption keys on the op, but its rationale is the column — your test says discovery may exclude the axis. Measured with `order_ts` absent from `get_compatible_dimensions`: `dimensions=['order_ts']` is rejected, so grouping a metric by its own time axis fails.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] fix(mcp): pre-validate metric/dimension compatibility in semantic-view get_table [superset]

Posted by "aminghadersohi (via GitHub)" <gi...@apache.org>.
aminghadersohi commented on code in PR #44265:
URL: https://github.com/apache/superset/pull/44265#discussion_r4034959120


##########
superset/mcp_service/semantic_layer/tool/get_table.py:
##########
@@ -322,6 +326,30 @@ async def _run_get_table_query(
             error_type="ValidationError",
         )
 
+    required_dimensions: set[str] = set(request.dimensions) | {
+        query_filter.col for query_filter in request.filters
+    }

Review Comment:
   `order_by` names land in the same dimension position (`_get_order_from_query_object` binds them via `all_dimensions`), so they still bypass this. Measured: `order_by=['product_name']` executes unguarded. Intersecting with `valid_columns` keeps metric ordering working.
   ```suggestion
       required_dimensions: set[str] = (
           set(request.dimensions)
           | {query_filter.col for query_filter in request.filters}
           | (set(request.order_by) & resolved.valid_columns)
       )
   ```



##########
superset/mcp_service/semantic_layer/tool/get_table.py:
##########
@@ -322,6 +326,30 @@ async def _run_get_table_query(
             error_type="ValidationError",
         )
 
+    required_dimensions: set[str] = set(request.dimensions) | {
+        query_filter.col for query_filter in request.filters
+    }
+    if (
+        not is_builtin
+        and resolved.view is not None
+        and request.metrics
+        and required_dimensions
+    ):
+        compatible: set[str] = set(
+            resolved.view.get_compatible_dimensions(request.metrics, [])
+        )
+        incompatible: list[str] = sorted(required_dimensions - compatible)

Review Comment:
   Including `filters[].col` makes the two temporal forms diverge: a `TEMPORAL_RANGE` filter on `order_ts` is now rejected, while `time_column="order_ts"` + `time_range` — which `_build_query_dict` turns into that exact filter — still passes. Measured both.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] fix(mcp): pre-validate metric/dimension compatibility in semantic-view get_table [superset]

Posted by "netlify[bot] (via GitHub)" <gi...@apache.org>.
netlify[bot] commented on PR #44265:
URL: https://github.com/apache/superset/pull/44265#issuecomment-5708991156

   ### <span aria-hidden="true">✅</span> Deploy Preview for *superset-docs-preview* ready!
   
   
   |  Name | Link |
   |:-:|------------------------|
   |<span aria-hidden="true">🔨</span> Latest commit | e57564e789eca564c24beaee76f4c55e070d6436 |
   |<span aria-hidden="true">🔍</span> Latest deploy log | https://app.netlify.com/projects/superset-docs-preview/deploys/6aab745422b5e40008d4f37c |
   |<span aria-hidden="true">😎</span> Deploy Preview | [https://deploy-preview-44265--superset-docs-preview.netlify.app](https://deploy-preview-44265--superset-docs-preview.netlify.app) |
   |<span aria-hidden="true">📱</span> Preview on mobile | <details><summary> Toggle QR Code... </summary><br /><br />![QR Code](https://app.netlify.com/qr-code/eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1cmwiOiJodHRwczovL2RlcGxveS1wcmV2aWV3LTQ0MjY1LS1zdXBlcnNldC1kb2NzLXByZXZpZXcubmV0bGlmeS5hcHAifQ.dHQCZWsqBUC4ufa_qHJCyireKVn8iE1BGN_Rw_k5FBU)<br /><br />_Use your smartphone camera to open QR code link._</details> |
   |<span aria-hidden="true">🤖</span> Make changes | [Run an agent on this branch](https://app.netlify.com/projects/superset-docs-preview/agent-runs#DcoxDoAgDADAv3SWBLGA-gOfUQrqgEKUxRj_brcb7oV6laM2mAE6CBedvItvVr3Rk0O1paYahZwUy6MmK6aay7NEeY4oeLRoTLAJtdZjxHXwDN8P) |
   ---
   <!-- [superset-docs-preview Preview](https://deploy-preview-44265--superset-docs-preview.netlify.app) -->
   _To edit notification comments on pull requests, go to your [Netlify project configuration](https://app.netlify.com/projects/superset-docs-preview/configuration/notifications#deploy-notifications)._


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] fix(mcp): pre-validate metric/dimension compatibility in semantic-view get_table [superset]

Posted by "aminghadersohi (via GitHub)" <gi...@apache.org>.
aminghadersohi commented on code in PR #44265:
URL: https://github.com/apache/superset/pull/44265#discussion_r4045208084


##########
superset/mcp_service/semantic_layer/tool/get_table.py:
##########
@@ -322,6 +333,32 @@ async def _run_get_table_query(
             error_type="ValidationError",
         )
 
+    required_dimensions: set[str] = (
+        set(request.dimensions)
+        | {query_filter.col for query_filter in request.filters}
+        | (set(request.order_by) & resolved.valid_columns)
+    ) - resolved.temporal_columns

Review Comment:
   Widening this to all temporal columns was our earlier ask, so bito's counter-suggestion to narrow back to TEMPORAL_RANGE-only would restore the inconsistency we filed: `dimensions=['order_ts']` rejected while `time_column`+`time_range` passed. Keep it as-is.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] fix(mcp): pre-validate metric/dimension compatibility in semantic-view get_table [superset]

Posted by "mikebridge (via GitHub)" <gi...@apache.org>.
mikebridge commented on PR #44265:
URL: https://github.com/apache/superset/pull/44265#issuecomment-5735487843

   Merged Apache master at ae5d8d89a3812be752c839da83fd39864fe8aa54 in [f828513e49](https://github.com/apache/superset/commit/f828513e49f07b6ae4a446603febf5de93cfbf43). The resolution preserves compatibility pre-validation, including the metadata-confirmed temporal exemption across grouping, filters and ordering, alongside #44270 time-grain validation and per-column hints. Both test groups remain; grain-result fixtures explicitly declare compatible ordinary dimensions so they exercise both behaviors together.
   
   Validation: 469 affected MCP tests and all applicable branch-file hooks passed. Python review and independent review approved the exact published tree with zero findings. New-head CI is running; this is not a CI-green claim.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] fix(mcp): pre-validate metric/dimension compatibility in semantic-view get_table [superset]

Posted by "codecov[bot] (via GitHub)" <gi...@apache.org>.
codecov[bot] commented on PR #44265:
URL: https://github.com/apache/superset/pull/44265#issuecomment-5671460941

   ## [Codecov](https://app.codecov.io/gh/apache/superset/pull/44265?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
   :white_check_mark: All modified and coverable lines are covered by tests.
   :white_check_mark: Project coverage is 76.32%. Comparing base ([`43a0031`](https://app.codecov.io/gh/apache/superset/commit/43a0031995636537ce5ff8909e4b7de07a0ee4d5?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`2cd5dd8`](https://app.codecov.io/gh/apache/superset/commit/2cd5dd80cf98017876fe224fb4e1c72a06ac1985?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
   :warning: Report is 4 commits behind head on master.
   
   <details><summary>Additional details and impacted files</summary>
   
   
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #44265      +/-   ##
   ==========================================
   - Coverage   80.21%   76.32%   -3.89%     
   ==========================================
     Files        2926     2926              
     Lines      172919   172925       +6     
     Branches    40115    40117       +2     
   ==========================================
   - Hits       138706   131991    -6715     
   - Misses      31619    38244    +6625     
   - Partials     2594     2690      +96     
   ```
   
   | [Flag](https://app.codecov.io/gh/apache/superset/pull/44265/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
   |---|---|---|
   | [hive](https://app.codecov.io/gh/apache/superset/pull/44265/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `37.33% <28.57%> (-0.01%)` | :arrow_down: |
   | [mysql](https://app.codecov.io/gh/apache/superset/pull/44265/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
   | [postgres](https://app.codecov.io/gh/apache/superset/pull/44265/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
   | [presto](https://app.codecov.io/gh/apache/superset/pull/44265/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `39.21% <28.57%> (-0.01%)` | :arrow_down: |
   | [python](https://app.codecov.io/gh/apache/superset/pull/44265/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `76.94% <100.00%> (-7.68%)` | :arrow_down: |
   | [sqlite](https://app.codecov.io/gh/apache/superset/pull/44265/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
   | [unit](https://app.codecov.io/gh/apache/superset/pull/44265/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `76.02% <100.00%> (+0.01%)` | :arrow_up: |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#carryforward-flags-in-the-pull-request-comment) to find out more.
   </details>
   
   [:umbrella: View full report in Codecov by Harness](https://app.codecov.io/gh/apache/superset/pull/44265?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).   
   :loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
   <details><summary> :rocket: New features to boost your workflow: </summary>
   
   - :snowflake: [Test Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, report on failures, and find test suite problems.
   - :package: [JS Bundle Analysis](https://docs.codecov.com/docs/javascript-bundle-analysis): Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
   </details>


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] fix(mcp): pre-validate metric/dimension compatibility in semantic-view get_table [superset]

Posted by "bito-code-review[bot] (via GitHub)" <gi...@apache.org>.
bito-code-review[bot] commented on PR #44265:
URL: https://github.com/apache/superset/pull/44265#issuecomment-5671275821

   AI Code Review is in progress (usually takes 3 to 15 minutes unless it's a very large PR).


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] fix(mcp): pre-validate metric/dimension compatibility in semantic-view get_table [superset]

Posted by "mikebridge (via GitHub)" <gi...@apache.org>.
mikebridge commented on code in PR #44265:
URL: https://github.com/apache/superset/pull/44265#discussion_r4042131981


##########
superset/mcp_service/semantic_layer/tool/get_table.py:
##########
@@ -322,6 +326,30 @@ async def _run_get_table_query(
             error_type="ValidationError",
         )
 
+    required_dimensions: set[str] = set(request.dimensions) | {
+        query_filter.col for query_filter in request.filters
+    }
+    if (
+        not is_builtin
+        and resolved.view is not None
+        and request.metrics
+        and required_dimensions
+    ):
+        compatible: set[str] = set(
+            resolved.view.get_compatible_dimensions(request.metrics, [])
+        )
+        incompatible: list[str] = sorted(required_dimensions - compatible)

Review Comment:
   addressed in ffb1407d7917cfa246f07f581a8ba0d65f2c7f74



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] fix(mcp): pre-validate metric/dimension compatibility in semantic-view get_table [superset]

Posted by "mikebridge (via GitHub)" <gi...@apache.org>.
mikebridge commented on code in PR #44265:
URL: https://github.com/apache/superset/pull/44265#discussion_r4048090548


##########
superset/mcp_service/semantic_layer/tool/get_table.py:
##########
@@ -322,6 +333,32 @@ async def _run_get_table_query(
             error_type="ValidationError",
         )
 
+    required_dimensions: set[str] = (
+        set(request.dimensions)
+        | {query_filter.col for query_filter in request.filters}
+        | (set(request.order_by) & resolved.valid_columns)
+    ) - resolved.temporal_columns

Review Comment:
   Agreed — keeping the metadata-confirmed temporal exemption across dimensions, filters, and ordering; narrowing it to TEMPORAL_RANGE would restore that inconsistency.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] fix(mcp): pre-validate metric/dimension compatibility in semantic-view get_table [superset]

Posted by "mikebridge (via GitHub)" <gi...@apache.org>.
mikebridge commented on PR #44265:
URL: https://github.com/apache/superset/pull/44265#issuecomment-5708968250

   Addressed https://github.com/apache/superset/pull/44265#discussion_r4015790697 in e57564e789eca564c24beaee76f4c55e070d6436: compatibility uses selected dimensions plus filters[].col, including requests with no grouping dimensions. Invalid filter dimensions fail ValidationError before build/execute; a compatible filter-only request still executes with its filter intact. Bito's two dead mock return setups in the skip test were also removed.
   
   Two new rejection cases fail before the fix; final scoped suite:48passed. Full-branch Python/semantic review and applicable file-scoped hooks (including MyPy) pass. A manually composed snapshot with #44270's grain remediation passes5targeted checks and preserves view plus grain_column/valid_grains/temporal_columns. This is integrated fixture evidence; whichever PR lands second still needs final merge reconciliation. Fresh CI/reviewer confirmation remains, and no thread was auto-resolved.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] fix(mcp): pre-validate metric/dimension compatibility in semantic-view get_table [superset]

Posted by "mikebridge (via GitHub)" <gi...@apache.org>.
mikebridge commented on code in PR #44265:
URL: https://github.com/apache/superset/pull/44265#discussion_r4041158952


##########
superset/mcp_service/semantic_layer/tool/get_table.py:
##########
@@ -322,6 +326,27 @@ async def _run_get_table_query(
             error_type="ValidationError",
         )
 
+    if (
+        not is_builtin
+        and resolved.view is not None
+        and request.metrics
+        and request.dimensions

Review Comment:
   Addressed in e57564e — `filters[].col` values are now folded into the required-dimension set, so a filter-only dimension goes through the same metric-compatibility check as the requested dimensions.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] fix(mcp): pre-validate metric/dimension compatibility in semantic-view get_table [superset]

Posted by "aminghadersohi (via GitHub)" <gi...@apache.org>.
aminghadersohi merged PR #44265:
URL: https://github.com/apache/superset/pull/44265


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] fix(mcp): pre-validate metric/dimension compatibility in semantic-view get_table [superset]

Posted by "bito-code-review[bot] (via GitHub)" <gi...@apache.org>.
bito-code-review[bot] commented on PR #44265:
URL: https://github.com/apache/superset/pull/44265#issuecomment-5722693498

   AI Code Review is in progress (usually takes 3 to 15 minutes unless it's a very large PR).
   
   <details>
   <summary>
   Bito Usage Guide
   </summary>
   
   **Commands**
         
   Type the following command in the pull request comment and save the comment.
         
   - `/review` - Manually triggers an incremental AI Review.
   - `/review full` - 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 <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent/available-commands" target="_blank" rel="noopener noreferrer">documentation</a> for additional commands.
         
   **Configuration**
   
   This repository uses `Superset` You can customize the agent settings <a href="https://alpha.bito.ai/home/ai-agents/code-review-agent" target="_blank" rel="noopener noreferrer">here</a> or contact your Bito workspace admin at evan@preset.io.
         
   **Documentation & Help**
   - <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent/getting-started/install-run-using-bito-cloud/create-or-customize-an-agent-instance" target="_blank" rel="noopener noreferrer">Customize agent settings</a>
   - <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent/implementing-custom-code-review-rules" target="_blank" rel="noopener noreferrer">Review rules</a>
   - <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent" target="_blank" rel="noopener noreferrer">General documentation</a>
   - <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent/faqs" target="_blank" rel="noopener noreferrer">FAQ</a>
   
   </details>
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org