bito-code-review[bot] commented on PR #44603:
URL: https://github.com/apache/superset/pull/44603#issuecomment-5841011901
<!-- Bito Reply -->
The flagged issue is correct. The current implementation of
`_build_column_error` in
`superset/mcp_service/chart/validation/dataset_validator.py` uses
`ChartErrorBuilder.column_not_found_error` for multiple invalid columns, which
is designed for a single column and thus reports a misleading error message.
To resolve this, you should update the `else` block to use a more
appropriate error builder method or ensure the `ChartErrorBuilder` is
configured to handle multiple column names correctly without implying a
single-column failure. Given the current structure, you can explicitly set the
error message or use a generic error builder that supports multiple invalid
columns.
**superset/mcp_service/chart/validation/dataset_validator.py**
```
else:
invalid_names = [col.name for col in invalid_columns if col.name]
error = ChartErrorBuilder.build_error(
error_type="multiple_invalid_columns",
template_key="multiple_columns_not_found",
template_vars={"columns": ", ".join(invalid_names)},
error_code="MULTIPLE_INVALID_COLUMNS"
)
```
--
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]