You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by ms...@apache.org on 2026/03/23 15:20:04 UTC

(superset) branch master updated: fix(AlertsReports): validate anchor_list is a list (#38723)

This is an automated email from the ASF dual-hosted git repository.

msyavuz 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 100ad7d9eec fix(AlertsReports): validate anchor_list is a list (#38723)
100ad7d9eec is described below

commit 100ad7d9eec7f2b3282646175f9adacee9ad1950
Author: Mehmet Salih Yavuz <sa...@proton.me>
AuthorDate: Mon Mar 23 18:19:57 2026 +0300

    fix(AlertsReports): validate anchor_list is a list (#38723)
---
 superset/commands/report/execute.py              | 6 +++++-
 tests/unit_tests/commands/report/execute_test.py | 6 ++++++
 2 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/superset/commands/report/execute.py b/superset/commands/report/execute.py
index 11593649815..90f574e27cb 100644
--- a/superset/commands/report/execute.py
+++ b/superset/commands/report/execute.py
@@ -268,7 +268,11 @@ class BaseReportState:
             native_filter_params = self._report_schedule.get_native_filters_params()
             if anchor := dashboard_state.get("anchor"):
                 try:
-                    anchor_list: list[str] = json.loads(anchor)
+                    anchor_list = json.loads(anchor)
+                    if not isinstance(anchor_list, list):
+                        raise json.JSONDecodeError(
+                            "Anchor value is not a list", anchor, 0
+                        )
                     urls = self._get_tabs_urls(
                         anchor_list,
                         native_filter_params=native_filter_params,
diff --git a/tests/unit_tests/commands/report/execute_test.py b/tests/unit_tests/commands/report/execute_test.py
index b2481be1bb3..e40a45d9bbe 100644
--- a/tests/unit_tests/commands/report/execute_test.py
+++ b/tests/unit_tests/commands/report/execute_test.py
@@ -259,6 +259,12 @@ def test_log_data_with_missing_values(mocker: MockerFixture) -> None:
             ["url1"],
             ["superset/dashboard/p/url1/"],
         ),
+        # Test JSON scalar string anchor falls back to single tab
+        (
+            json.dumps("mock_tab_anchor_1"),
+            ["url1"],
+            ["superset/dashboard/p/url1/"],
+        ),
     ],
 )
 @patch(