dosubot[bot] commented on issue #34291: URL: https://github.com/apache/superset/issues/34291#issuecomment-3110456462
<!-- Greeting --> Hi @alexray92! I'm [Dosu](https://go.dosu.dev/dosubot) and I’m helping the superset team. <!-- Answer --> This error is caused by a bug in the import logic: during dashboard import, the code assigns a JSON string to `query_context['form_data']` when it should be a dictionary. This breaks downstream code that expects a dict, leading to the `TypeError` and `AttributeError` you see ([source](https://github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset/commands/utils.py)). This is a known behavior in Superset's import/export flow—charts may lack a valid query context after import, which can trigger errors and warnings, even if charts and filters appear to work ([source](https://github.com/apache/superset/issues/33615)). The recommended workaround is to manually open and save each chart in the UI after import. This regenerates the query context as a dictionary and resolves the error. If you have many charts, you can automate this with browser automation tools like Cypress ([source](https://github.com/apache/superset/issues/33615)). There is no built-in Superset command or API to bulk-repair these query contexts. Recent pull requests show ongoing work to handle data type mismatches during import/export, but this specific issue with `form_data` as a string is not fully resolved in 4.1.x ([source](https://github.com/apache/superset/pull/34080)). For future imports, always ensure you export all related components (databases, datasets, charts, dashboards) and, after import, open and save each chart to avoid this problem ([source](https://github.com/apache/superset/discussions/34022)). If you want to patch the import logic to fix this at the code level, let me know and I can point you to the relevant code paths. <!-- Dosu Comment Footer --> *To reply, just mention [@dosu](https://go.dosu.dev/dosubot).* --- <sup>How did I do? [Good](https://app.dosu.dev/response-feedback/5edda624-af3d-4627-b870-c2509e35f935?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/5edda624-af3d-4627-b870-c2509e35f935?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/5edda624-af3d-4627-b870-c2509e35f935?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/5edda624-af3d-4627-b870-c2509e35f935?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/5edda624-af3d-4627-b870-c2509e35f935?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/5edda624-af3d-4627-b870-c2509e35f935?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/5edda624-af3d-4627-b870-c2509e35f935?feedback_type=other)</sup> [](https://app.dosu.dev/a28d3c7e-a9d3-459e-9fb6-3a6f9ff4f357/ask?utm_source=githu b) [](https://go.dosu.dev/discord-bot) [](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/apache/superset/issues/34291) -- 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: notifications-unsubscr...@superset.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: notifications-unsubscr...@superset.apache.org For additional commands, e-mail: notifications-h...@superset.apache.org