sadpandajoe commented on code in PR #43527:
URL: https://github.com/apache/superset/pull/43527#discussion_r3858989437
##########
superset/mcp_service/semantic_layer/tool/get_table.py:
##########
@@ -191,59 +195,31 @@ def _validate_request_names(
request: GetTableRequest, valid_columns: set[str], valid_metrics: set[str]
) -> list[str]:
"""Validate requested dimensions, metrics, filters, and order_by names."""
- validation_errors: list[str] = []
- validation_errors.extend(
- validate_names(request.dimensions, valid_columns, "dimension")
- )
- validation_errors.extend(
- validate_names(
- request.metrics,
- valid_metrics,
- "metric",
- empty_hint=_NO_METRICS_HINT,
- list_valid_on_miss=True,
- full_list_hint="call list_metrics for the full list",
- )
- )
- filter_cols = [f.col for f in request.filters]
- validation_errors.extend(
- validate_names(filter_cols, valid_columns, "filter column")
+ return validate_query_names(
Review Comment:
This now uses the shared validator's default truncated-list hint,
`get_dataset_info`, when an external semantic view has more than ten metrics
and a requested metric has no close match. That tool cannot inspect
semantic-view IDs, so callers are directed to a dead end instead of
`list_metrics`; could this pass the previous `list_metrics` hint into the
shared validator?
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]