Bug description

how to reproduce the error: 1) In the dataset settings, go to the Settings tab 2)In the Template parameters, enter any parameter 3)save dataset settings 4)Reopen the dataset settings for editing and delete the previously entered Template parameters 5)save dataset settings 6)Export an object (dashboard, chart or the dataset itself) that contains this dataset 7) Execute import

in yaml file dataset - template_params: ''

Screenshots/recordings

Image

Image

Superset version

master / latest-dev

Python version

3.9

Node version

16

Browser

Chrome

Additional context

No response

Checklist

  • [ ] I have searched Superset docs and Slack and didn't find a solution to my problem.
  • [ ] I have searched the GitHub issue tracker and didn't find a similar bug report.
  • [ ] I have checked Superset's logs for errors and if I found a relevant Python stacktrace, I included it here as text in the "additional context" section.

Comment From: dosubot[bot]

This error happens because Superset exports template_params as a string (which can be an empty string), but the import process expects it to be a dictionary or null. If you clear the template parameters and save, the exported YAML will have template_params: "", which causes a validation error on import since it's not a valid mapping type reference.

To work around this, before importing, open the exported YAML and change any line like template_params: "" to either template_params: {} or remove the line entirely. This will let the import succeed.

Recent code changes have improved error handling for template processing, but this specific normalization for template_params is not yet handled automatically reference. Until that's addressed, manual YAML editing is the best workaround.

To reply, just mention @dosu.


How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other  Chat with Dosu Join Discord Share on X