superset
superset copied to clipboard
feat(explore): Don't discard controls with custom sql when changing datasource
SUMMARY
Currently, when user changes datasource in Explore, we try to keep controls that use columns available in the new datasource, but we always discard adhoc columns/metrics/filters that use custom SQL. This PR changes that behaviour by always keeping the controls with custom sql, but with added warning icon. We can't reliably verify if controls with custom SQL are compatible with the new datasource, so we let the user decide (since it's quicker to remove a control than to create it from scratch). If user runs a successful query, the warning icons disappear.
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
https://user-images.githubusercontent.com/15073128/182167215-e3606801-5ec9-4b3e-b7f7-fec893fea6b0.mov
TESTING INSTRUCTIONS
- Add some controls with custom sql
- Switch to a different datasource
- Verify that the controls with custom sql now have a warning icon with a tooltip
- If the next query is successful, the warning icons should disappear. Otherwise, they should still be displayed
ADDITIONAL INFORMATION
- [ ] Has associated issue:
- [ ] Required feature flags:
- [ ] Changes UI
- [ ] Includes DB Migration (follow approval process in SIP-59)
- [ ] Migration is atomic, supports rollback & is backwards-compatible
- [ ] Confirm DB migration upgrade and downgrade tested
- [ ] Runtime estimates and downtime expectations provided
- [ ] Introduces new feature or API
- [ ] Removes existing feature or API