dashboard slug is cleared on import
See original GitHub issueImport a dashboard using superset import-dashboards
cmd
Expected results
dashboard is imported as yaml file described
Actual results
dashboard is imported but slug is cleared
Environment
(please complete the following information):
- superset version:
0.37
- python version:
Python 3.8.5
- node.js version:
v12.4.0
- npm version:
6.14.7
Checklist
Make sure these boxes are checked before submitting your issue - thank you!
- I have checked the superset logs for python stacktraces and included it here as text if there are any.
- I have reproduced the issue with at least the latest released version of superset.
- I have checked the issue tracker for the same issue and I haven’t found one similar.
Additional context
The slug is cleared on purpose, which is to avoid conflict, see https://github.com/apache/incubator-superset/blob/master/superset/models/dashboard.py#L316. But that behavior is not expected in some cases. If a dashboard is exported to a yaml and imported later, I would expect the same dashboard gets overwritten rather than creating a new dashboard with an empty slug. This is very useful when I want to create/update dashboard automatically without manual intervene. If user wants to avoid conflict, user can manually edit dashboard yaml file and set slug to null instead of hard clear in superset code.
Issue Analytics
- State:
- Created 3 years ago
- Comments:8 (5 by maintainers)
Top GitHub Comments
@villebro The slug is cleared on purpose, which is to avoid conflict, see https://github.com/apache/incubator-superset/blob/master/superset/models/dashboard.py#L316. But that behavior is not expected in some cases. If a dashboard is exported to a yaml and imported later, I would expect the same dashboard gets overwritten rather than creating a new dashboard with an empty slug. This is very useful when I want to create/update dashboard automatically without manual intervene. If user wants to avoid conflict, user can manually edit dashboard yaml file and set slug to null instead of hard clear in superset code. I use a script to create the dashboard.yaml and import into superset. Without the slug, I don’t know how to reference the created dashboard in superset db.
the best solution I’ve foubdn so far (as of version
1.5.1
) is to have an import script that roughyl does the following:PUT
to set the slug values on each