superset
superset copied to clipboard
Charts duplicating in tabs
Bug description
Hi, I think there is a bug. I am using the most recent version, 4.0.0. I am using tabs in the dashboard, and for some unknown reason, some charts that I added to one tab also display in all other tabs. If I delete this chart from one tab, it also deletes from all the other tabs. If I add another tab, these charts will be added automatically if they are present in the other tabs.
I started to debug and I think I've found how this happens, but not why. Looking at the database table 'dashboards', column 'position_json', all working charts have five parents, but the wrong charts don't have the parent tabs.
"CHART-psM0LLtTBc": {
"children": [],
"id": "CHART-psM0LLtTBc",
"meta": {
"chartId": 142,
"height": 50,
"sliceName": "Sales",
"uuid": "1e79c3f4-e388-42d8-aa8f-0c41f24351d5",
"width": 12
},
"parents": [
"ROOT_ID",
"GRID_ID",
"TABS-RVg9XImKja",
"TAB-_5SRUXFBC",
"ROW-L3m0WfT_l_"
],
"type": "CHART"
},
"CHART-uWtgnzN_0_": {
"children": [],
"id": "CHART-uWtgnzN_0_",
"meta": {
"chartId": 141,
"height": 64,
"sliceName": "Shipping",
"uuid": "d1a48172-4305-47bd-81cc-1a74b398896c",
"width": 12
},
"parents": [
"ROOT_ID",
"GRID_ID",
"ROW-ktUUc_Sn-y"
],
"type": "CHART"
},
How to reproduce the bug
I don't know how to reproduce yet but I can come later.
Screenshots/recordings
No response
Superset version
master / latest-dev
Python version
3.9
Node version
16
Browser
Chrome
Additional context
No response
Checklist
- [X] 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.
- [X] 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.
Update 1 - This is not a problem with any specific chart. Since the behavior starts, any other added chart happens the same. Even with charts that were working correctly, if removed and added again, they will appear in all tabs.
Update 2 - I recreated the dashboard with the same charts and the problem has gone. To build the dashboard I had to make a lot of changes in the charts, datasets, queries, tabs, naming and other configurations. Maybe something brake then.
I still have the non working dashboard and I tried to debug in the browser, but I didn't find any clue in the request/response. If you need more information, please just let me know.
If you see any errors in your logs or browser console, or know any reproduction steps to recreate your problematic dashboard, that might be really helpful. If we can't reproduce it, this issue might go stale and get closed at some point.
Could it be the case that you think you are adding a chart to a tab, but you're silently adding it under the tab where it is global? Try dragging the chart up to be the top chart on a tab -- above a different chart that correctly appears on only one tab.
I've had this problem, and even now that I'm aware of it, sometimes the only way I know to make the chart (or widget, or whatever) appear on only one tab is to drag it up to be above another chart that is on the tab, then drag that chart above my new chart. Then I get the ordering of charts I want and both are on the tab.
As @sfirke mentioned it's possible to have a structure where a chart isn't nested underneath any particular tab. Such a structure might look like this under the hood: ROOT └── GRID ├── TABS │ ├── TAB1 │ └── TAB2 └── ROW └── CHART In this scenario, regardless of which tab is selected, you'd still see the output of the chart beneath the tabs since it's not nested inside the tabs.
Was this the case in your scenario?
@sfirke - You are absolutely right. It was added globally. When I was researching for the problem I saw people saying that it was not possible to add charts globally, so I didn't consider this option. I am sorry for the late reply, I've been very busy. Thank you!