msyavuz opened a new pull request, #43330: URL: https://github.com/apache/superset/pull/43330
### SUMMARY In SQL Lab the **Save dataset** toolbar button was gated only on `database.allows_virtual_table_explore`, never on the query result. After a failed run it stayed enabled, so you could create a virtual dataset off SQL that produced no result set (columns come from `latestQuery.results.columns`, which is stale from an earlier success or empty). The button is now gated on `latestQuery?.state === 'success'` and rendered disabled with the tooltip *"You must run the query successfully first"* — the same pattern the Schedule query button already uses. **Save query** is unaffected; only dataset creation requires a successful run. ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF _To be added._ ### TESTING INSTRUCTIONS 1. SQL Lab → examples / main → run `SELECT bad FROM definitely_not_a_table_xyz`. 2. Once the query fails, **Save dataset** is disabled and hovering it explains why. 3. Run a valid query — the button becomes enabled again. Unit tests: `npm run test -- src/SqlLab/components/SaveDatasetActionButton src/SqlLab/components/SqlEditor` ### ADDITIONAL INFORMATION - [ ] Has associated issue: No - [ ] Required feature flags: None - [x] Changes UI — Save dataset button is disabled after a failed/unrun query - [ ] Includes DB Migration: No - [ ] Introduces new feature or API: No - [ ] Removes existing feature or API: No -- 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]
