khaa-dv commented on code in PR #43577:
URL: https://github.com/apache/superset/pull/43577#discussion_r3879418486


##########
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:
   Good catch, thanks — fixed in 
<https://github.com/apache/superset/commit/1b4182199a83626e2897dda949a265c9f887dd78>:
 `_ensure_list` now filters out `None`/empty-string values, so an unset control 
resolves to `[]` instead of `[""]`. Added a regression test 
(`test_query_context_modified_unset_scalar_control_not_tampered`) covering this 
case.



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