This is an automated email from the ASF dual-hosted git repository.
sadpandajoe pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/superset.git
The following commit(s) were added to refs/heads/master by this push:
new d7717743b1f test(utils): add unit test for scalar_to_sequence (#45144)
d7717743b1f is described below
commit d7717743b1f071b6cdc8c8e54e1e1d9cb1478f95
Author: roopemattila <[email protected]>
AuthorDate: Sat Oct 10 23:37:21 2026 +0300
test(utils): add unit test for scalar_to_sequence (#45144)
---
tests/unit_tests/pandas_postprocessing/test_utils.py | 18 +++++++++++++++++-
1 file changed, 17 insertions(+), 1 deletion(-)
diff --git a/tests/unit_tests/pandas_postprocessing/test_utils.py
b/tests/unit_tests/pandas_postprocessing/test_utils.py
index 7efe617724b..1d7bd3e3a8f 100644
--- a/tests/unit_tests/pandas_postprocessing/test_utils.py
+++ b/tests/unit_tests/pandas_postprocessing/test_utils.py
@@ -23,7 +23,10 @@ from superset.utils.pandas_postprocessing import (
pivot,
unescape_separator,
)
-from superset.utils.pandas_postprocessing.utils import _append_columns
+from superset.utils.pandas_postprocessing.utils import (
+ _append_columns,
+ scalar_to_sequence,
+)
from tests.unit_tests.pandas_postprocessing.utils import series_to_list
@@ -122,3 +125,16 @@ def
test_append_columns_with_empty_mapping_returns_a_copy():
assert post_df is not base_df
assert post_df.columns.tolist() == ["y"]
assert series_to_list(post_df["y"]) == [1.0, 2.0]
+
+
+def test_scalar_to_sequence() -> None:
+ """
+ None becomes an empty list.
+
+ A string is wrapped in a list.
+
+ A list is unchanged.
+ """
+ assert scalar_to_sequence(None) == []
+ assert scalar_to_sequence("a") == ["a"]
+ assert scalar_to_sequence(["a", "b"]) == ["a", "b"]