You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2019/09/26 02:41:13 UTC

[GitHub] [incubator-superset] suddjian opened a new pull request #8298: Allow overwriting a SQLLab query that has previously been saved

suddjian opened a new pull request #8298: Allow overwriting a SQLLab query that has previously been saved
URL: https://github.com/apache/incubator-superset/pull/8298
 
 
   ### CATEGORY
   
   Choose one
   
   - [x] Bug Fix
   - [ ] Enhancement (new features, refinement)
   - [ ] Refactor
   - [ ] Add tests
   - [ ] Build / Development Environment
   - [ ] Documentation
   
   ### SUMMARY
   <!--- Describe the change below, including rationale and design decisions -->
   
   When saving a query in SQLLab, currently there is no good way to update a query you were previously working on. You have to save a new one, then go to the saved queries list and delete the old one. This lets you overwrite the previous entry.
   
   A speed bump I ran into was that the frontend is using several field names that are different from the names the backend uses. My first instinct was to change that so that a field means the same thing everywhere, but that gets pretty complicated pretty fast, due to the way the redux state is being persisted locally - how does the Superset frontend do migrations? #7748 will probably allow solving this problem.
   
   So instead I grouped the existing differences (plus my addition of a `remoteId` field) into a `queryClientMapping` object, with the goal of isolating the differences to one layer of the system - where the client actually makes API calls. That way UI components like `SaveQuery` don't have to concern themselves with those differences. This hasn't been propagated to all parts of the code that use saved queries, yet.
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   <!--- Skip this if not applicable -->
   Before:
   <img width="318" alt="Screen Shot 2019-09-25 at 7 04 01 PM" src="https://user-images.githubusercontent.com/1858430/65652654-5049a380-dfc7-11e9-84eb-3e7d29f5fb59.png">
   After:
   <img width="321" alt="Screen Shot 2019-09-25 at 7 03 30 PM" src="https://user-images.githubusercontent.com/1858430/65652658-53449400-dfc7-11e9-9a1a-86bc90452af0.png">
   
   
   ### TEST PLAN
   <!--- What steps should be taken to verify the changes -->
   
   I've already tested it pretty well, I think. This is my first contribution to Superset so it's entirely possible that I missed something. It would be nice to get some additional verification that nothing I've done will mess up anyone's local state.
   
   ### ADDITIONAL INFORMATION
   <!--- Check any relevant boxes with "x" -->
   <!--- HINT: Include "Fixes #nnn" if you are fixing an existing issue -->
   - [x] Has associated issue: Fixes #8068
   - [ ] Changes UI
   - [ ] Requires DB Migration.
   - [ ] Confirm DB Migration upgrade and downgrade tested.
   - [ ] Introduces new feature or API
   - [ ] Removes existing feature or API
   
   ### REVIEWERS
   

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org