aminghadersohi opened a new pull request, #45575: URL: https://github.com/apache/superset/pull/45575
### SUMMARY Follow-up to https://github.com/apache/superset/pull/45485 for two remaining diagnostic gaps: - The sanitizer emits `string_too_long`, but `field_validation_error` replaced it with `unsafe_text`. Preserve typed sanitizer errors, including in chart-name field validators, so over-limit titles report "String exceeds the allowed maximum length" instead of "Contains disallowed content". - `duplicate_dashboard` raised a plain `ValueError` for blank titles. Emit `empty_text` ("Text must not be empty") and keep canonical field locations for aliases. Sibling audit: - `generate_dashboard`, `update_dashboard`, `duplicate_dashboard`, `generate_chart`: all four `field_validation_error` call sites retain sanitizer error types; intentional plain rejection of content stripped entirely still maps to `unsafe_text`. - `update_chart`: its existing 255-character Field constraint already reports length correctly; remove its redundant sanitizer error relabeling alongside `generate_chart`. - Optional generate/update titles: empty-value semantics unchanged. - `ColumnRef.name`/`label`, temporal/filter/Gantt columns and values, time ranges, comparison periods, SQL expressions, Bullet labels, and dashboard certification fields: direct typed sanitizer errors, no relabeling or untyped sanitizing rejection remains. - `CreateThemeRequest.reject_blank_theme_name`: plain blank-name validation, but not a sanitizing validator; unchanged and outside these title-sanitization paths. ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF Not applicable; MCP error text only. Rejected values are never echoed in wire diagnostics. ### TESTING INSTRUCTIONS Run with the repository and `superset-core/src` on `PYTHONPATH`: ```bash pytest -q tests/unit_tests/mcp_service/test_sanitization_warning_inputs.py \ tests/unit_tests/mcp_service/test_validation_contract.py \ tests/unit_tests/mcp_service/utils/test_sanitization*.py \ tests/unit_tests/mcp_service/utils/test_schema_utils.py \ tests/unit_tests/mcp_service/utils/test_error_sanitization.py \ -m 'not manual and not llm_compliance' ``` New FastMCP server/client wire regressions cover limit+1 and 600-character titles, canonical/title/name inputs, and empty/whitespace-only duplicate titles. Against unmodified master: 30 failed, 6 passed (145 deselected). After the change: all 36 new wire cases pass within 777 passing tests across the command above. `pre-commit run` on the five changed files passes, including mypy. Real-LLM checks were not run (OpenRouter disabled). ### ADDITIONAL INFORMATION - No UI, database migration, or feature flag changes. - Separate follow-up requested for these gaps; the related chart-filter work in https://github.com/apache/superset/pull/45486 is unchanged. -- 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]
