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

rusackas pushed a commit to branch change/33615-chart-data-query-context
in repository https://gitbox.apache.org/repos/asf/superset.git

commit f334de342f638571104d8f2c48f06ce38b1f3438
Author: Eugene Olkhovski <[email protected]>
AuthorDate: Wed Aug 19 12:33:10 2026 -0400

    fix(charts): remove duplicate import_chart call in bundle importer
    
    The query_context-synthesis rework left `_import` calling `import_chart` 
twice on the same config dict. The first call serializes `config["params"]` to 
a JSON string; the second call then passes that string to 
`filter_chart_annotations`, which does `params.get(...)` and raises 
AttributeError: 'str' object has no attribute 'get', surfacing as HTTP 500 on 
chart/dashboard import (test-postgres/-sqlite/-mysql).
    
    Collapse to a single call that passes `default_viewers`, deriving the 
per-chart synthesis counters from its result.
    
    Co-Authored-By: Claude Opus 4.8 <[email protected]>
---
 superset/commands/chart/importers/v1/__init__.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/superset/commands/chart/importers/v1/__init__.py 
b/superset/commands/chart/importers/v1/__init__.py
index a3baf509100..cc4d6b0e495 100644
--- a/superset/commands/chart/importers/v1/__init__.py
+++ b/superset/commands/chart/importers/v1/__init__.py
@@ -122,7 +122,8 @@ class ImportChartsCommand(ImportModelsCommand):
                 }
                 config = update_chart_config_dataset(config, dataset_dict)
                 # Capture the pre-import context state before `import_chart`
-                # mutates `config` (it synthesizes into 
config["query_context"]).
+                # mutates `config` (it synthesizes into config["query_context"]
+                # and serializes config["params"]).
                 had_query_context = bool(config.get("query_context"))
                 chart = import_chart(
                     config, overwrite=overwrite, 
default_viewers=default_viewers

Reply via email to