rafalpas opened a new issue #18109:
URL: https://github.com/apache/superset/issues/18109


   Problem reproduced with Superset 1.4rc4 with VERSIONED_EXPORT and 
DASHBOARD_NATIVE_FILTERS enabled - both are related to the problem.
   
   The native_filter_configuration section in dashboard's json metadata 
contains two fields that refer to charts with numeric IDs (chartsInScope and 
scope.excluded). When exporting and then importing a such a dashboard, while 
charts get new numeric IDs, the IDs are not updated. As a result the filter 
scoping definitions might be affected.
   
   #### How to reproduce the bug
   
   1. Install Superset 1.4rc4 with demo dashboards and VERSIONED_EXPORT, 
DASHBOARD_NATIVE_FILTERS feature flags enabled
   2. Create a new dashboard
   3. Add 2 charts (Boys, Girls) to the dashboard
   4. Add a Tab component
   5. Add 2 charts (Top 10 Boy Name Share, Top 1-- Girl Name Share) to the Tab 
component
   6. Save the dashboard
   
![image](https://user-images.githubusercontent.com/2510246/150337606-057563f2-2b02-4013-ae8a-9eecf29bdf52.png)
   7. Add a dashboard native filter on dataset "birth_names" and column "state"
   
![image](https://user-images.githubusercontent.com/2510246/150337733-f8e6a0cd-868d-4849-b1a0-ab45b46a98e8.png)
   8. Alter the scope of the filter to include only "boys" and "Top 10 Girl 
Name Share" and save
   
![image](https://user-images.githubusercontent.com/2510246/150337791-0a276bdd-79de-416f-a08f-c4ac1bd17bec.png)
   The filter is only applied to the desired charts
   
![image](https://user-images.githubusercontent.com/2510246/150337827-0c1129cf-c2b5-4975-9862-3cfb2abe3b51.png)
   9. Check the dashboard properties JSON METADATA - The 
native_filter_configuration contains references to numeric IDs of the charts 
("chartsInScope" and "scope"."excluded")
   
![image](https://user-images.githubusercontent.com/2510246/150337895-e1fa12ef-c518-41a6-b51f-7405591051d0.png)
   10. Export the dashboard.
   11. Delete all charts and dashboards
   12. Import the exported dashboard -> notice that the numeric Ids of the 4 
charts are now different (133, 134, 135, 136 in my case)
   13. Open the dashboard and activate the filter
   
   ### Expected results
   - The same two charts should be highlighted as after step 8
   
![image](https://user-images.githubusercontent.com/2510246/150337827-0c1129cf-c2b5-4975-9862-3cfb2abe3b51.png)
   
   ### Actual results
   - After step 13 all charts are highlighted (are in scope of the filter)
   
![image](https://user-images.githubusercontent.com/2510246/150338638-543d8dd1-e354-4a70-84fa-7183ea489dc1.png)
   - After checking filter scoping:
   
![image](https://user-images.githubusercontent.com/2510246/150338710-cf2a97fe-97fb-4929-87ae-aab4768d9f43.png)
   - After checking the JSON METADATA - still old IDs:
   
![image](https://user-images.githubusercontent.com/2510246/150338808-f6ce5f50-3641-474e-b1ab-25cbc632e447.png)
   
   #### Screenshots
   Added in the steps
   
   ### Environment
   
   - browser type and version: Microsoft Edge 96.0.1054.43
   - superset version: `superset version`: 1.4rc4
   - python version: `python --version`
   - node.js version: `node -v`
   - any feature flags active: VERSIONED_EXPORT, DASHBOARD_NATIVE_FILTERS, 
DASHBOARD_RBAC
   
   ### Checklist
   
   Make sure to follow these steps 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.
   - [x] I have checked the issue tracker for the same issue and I haven't 
found one similar.
   
   ### Additional context
   
   The problem can be partially reproduced with just two charts and without the 
tab component, but in this situation only one of the two fields with numeric 
IDs will be present in the dashboard's json metadata. Adding the tab component 
allows to see also the "scope"."excluded" field.


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to