sadpandajoe commented on code in PR #45575:
URL: https://github.com/apache/superset/pull/45575#discussion_r4356250833


##########
superset/mcp_service/chart/schemas.py:
##########
@@ -6377,15 +6367,18 @@ def _detect_chart_name_sanitization(cls, data: Any) -> 
Any:
             return data
         with field_validation_error("chart_name"):
             sanitized, was_modified = sanitize_user_input_with_changes(
-                raw, "Chart name", max_length=255, allow_empty=True
+                raw, "Chart name", max_length=250, allow_empty=True

Review Comment:
   The 250 cap is now applied by `sanitize_user_input` to the raw string, 
before tags are stripped. A name like `"<b>" + "x" * 245 + "</b>"` (252 raw 
chars) is rejected with `string_too_long`, while it would sanitize to a valid 
245-character name and was accepted under the old 255 cap. `generate_chart` and 
`update_chart` both go through this. Is it intended that markup counts toward 
the name limit, or should the raw-input bound stay looser and the 250 check run 
on the sanitized value?



-- 
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]

Reply via email to