villebro opened a new pull request #16419: URL: https://github.com/apache/superset/pull/16419
### SUMMARY A feature was recently introduced to automatically populate `query_context` in the chart metadata. This was necessary to be able to render V1 charts reports. However, if a non-owner triggered the chart update command, the old ownership data was lost due to the update payload not containing the `owners` property. This was due to the `self.populate_owners` method setting the owners to whichever value was passed in the request, which in this case was always `None`. This PR changes the chart update command to not modify the `owners` property when calling the chart update command with `query_context_generation`. In addition, an integration test is added to ensure that a non-owner can update the query context payload without changing the `owners` property (test fails on master). ### TESTING INSTRUCTIONS 1. Start a fresh installation of Superset with a newly initiated metadata database and examples data populated 2. Login as Admin 2. Go to the Charts page and change one of the Examples chart owners from empty to "Admin" 3. Open the chart into Explore view 4. Go back to Charts page and check the chart owners - notice how the owners are empty again. Set the chart owner back to Admin. 5. Reopen the chart in Explore, go to the Charts page and notice that now Admin is still an owner. ### ADDITIONAL INFORMATION <!--- Check any relevant boxes with "x" --> <!--- HINT: Include "Fixes #nnn" if you are fixing an existing issue --> - [ ] Has associated issue: - [ ] Required feature flags: - [ ] Changes UI - [ ] Includes DB Migration (follow approval process in [SIP-59](https://github.com/apache/superset/issues/13351)) - [ ] 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 -- 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]
