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 2022/03/21 19:26:56 UTC

[GitHub] [superset] codemaster08240328 opened a new pull request #19291: fix: Saved query without description issue, None showing

codemaster08240328 opened a new pull request #19291:
URL: https://github.com/apache/superset/pull/19291


   <!---
   Please write the PR title following the conventions at https://www.conventionalcommits.org/en/v1.0.0/
   Example:
   fix(dashboard): load charts correctly
   -->
   
   ### SUMMARY
   <!--- Describe the change below, including rationale and design decisions -->
   When we save query without empty description, if we go to savedquery, edit a newly saved one, we would see `None` in description field by clicking `save` button. 
   
   It was because the `savedqueryviewapi/api/get/<pk>` endpoint returns `None` as a description for the saved query without description.
   
   I customized response in frontend so that if we get `None` as a description, we will omit `description` field from the response.
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   <!--- Skip this if not applicable -->
   BEFORE:
   [[DEV] Superset - 21 March 2022 - Watch Video](https://www.loom.com/share/587bb5198e424aacb4c6f6141a44d913)
   AFTER:
   [[DEV] Superset - 21 March 2022 - Watch Video](https://www.loom.com/share/9deb29b710f144629cb44504e64c427d)
   
   ### TESTING INSTRUCTIONS
   <!--- Required! What steps can be taken to manually verify the changes? -->
   
   - Save a query in SQL Lab. When saving, leave the description field blank
   - Visit the Saved Queries page and open your query in SQL Lab
   - Click the "Save" button
   - Track the description field.
   
   ### ADDITIONAL INFORMATION
   <!--- Check any relevant boxes with "x" -->
   <!--- HINT: Include "Fixes #nnn" if you are fixing an existing issue -->
   - [x] Small UI bug fix
   


-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [superset] diegomedina248 commented on a change in pull request #19291: fix: Saved query without description issue, None showing (Preset-Patch)

Posted by GitBox <gi...@apache.org>.
diegomedina248 commented on a change in pull request #19291:
URL: https://github.com/apache/superset/pull/19291#discussion_r831474399



##########
File path: superset-frontend/src/SqlLab/actions/sqlLab.js
##########
@@ -1273,6 +1273,11 @@ export function popSavedQuery(saveQueryId) {
       endpoint: `/savedqueryviewapi/api/get/${saveQueryId}`,
     })
       .then(({ json }) => {
+        // if description from result is 'None', need to omit this property.
+        if(json.result.description === 'None') {

Review comment:
       mm, what if I set the description as None?
   Unlikely, but in any case, possible.
   
   I think the problem needs to be fixed on the api side, None is being converted to string when in fact it should be translated to null or undefined.




-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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