serenajiang opened a new pull request #17781:
URL: https://github.com/apache/superset/pull/17781


   <!---
   Please write the PR title following the conventions at 
https://www.conventionalcommits.org/en/v1.0.0/
   Example:
   fix(dashboard): load charts correctly
   -->
   
   ### SUMMARY
   Recent changes to dashboard updates caused incorrect partial updates to be 
committed, resulting in malformed json in some db engines (mysql) and breaking 
dashboards that contained non ascii characters in headers or custom chart 
titles. This PR ensures that we only commit when all updates are complete.
   
   This issue emerged in #17570. I verified that #17766 seemed to fix the 
problem in a test env, but it turns out this problem is likely db specific, so 
it did not actually address the root cause:
   * `DashboardDAO.update` updates all properties naively, including 
`json_metadata`, which includes `positions`
   * `DashboardDAO.update_charts_owners` _commits the changes done in 
`DashboardDAO.update`_. Something goes wrong when committing a string with 
emojis, resulting in a truncated `dashboard.json_metadata` for mysql.
   * `DashboardDAO.set_dash_metadata` fetches `dashboard.params_dict`, which 
fails to parse due to malformed json. Error is thrown.
   
   Other locations where we save json with emojis inadvertently use 
`json.dumps(json.loads(...))` to encode the emojis in a mysql-friendly way, so 
we didn't see this before.
   
   ### TESTING INSTRUCTIONS
   Verified change locally with mysql db.
   
   ### ADDITIONAL INFORMATION
   @geido @kgabryje @graceguo-supercat @etr2460 
   


-- 
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