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


##########
superset/security/manager.py:
##########
@@ -1528,6 +1528,25 @@ def _stored_param_values(params: dict[str, Any], keys: 
tuple[str, ...]) -> set[s
     return values
 
 
+def _ensure_list(value: Any) -> list[Any]:
+    """
+    Normalize a value to a list for iteration.
+
+    Some viz types (e.g. heatmap_v2's 'groupby' control) store a single
+    value as a bare string rather than a one-item list. Iterating a string
+    directly yields its individual characters, which silently breaks the
+    guest payload comparison for any such chart.
+
+    ``None`` returns ``[]``; a ``list``/``tuple`` returns a list copy of
+    it; any other (scalar) value is wrapped in a single-item list.
+    """
+    if value is None:

Review Comment:
   An unset scalar control is now treated as a requested empty-string value 
instead of absent. When a saved chart has no value for that control, an 
otherwise unchanged guest request with `groupby: ""` fails the subset check as 
tampered. Should the empty-string case return `[]` like the stored-value path 
does?



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