pnadolny13 opened a new pull request, #19595:
URL: https://github.com/apache/superset/pull/19595

   <!---
   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 using the export_dashboards command on the CLI the order of the 
datasources in the json is inconsistent so if you're trying to use git 
versioning theres a big diff from reordering. This PR implements sorting so 
this no longer happens.
   
   Resolves: https://github.com/apache/superset/issues/19478
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   <!--- Skip this if not applicable -->
   
   NA
   
   ### TESTING INSTRUCTIONS
   <!--- Required! What steps can be taken to manually verify the changes? -->
   
   I edited 
https://github.com/apache/superset/blob/f91f83d011b4c83576f5fff76d502f5616f2972d/tests/integration_tests/cli_tests.py#L76
 like:
   
   ```python
       json_content = json.loads(contents)
   
       # check that datasources are ordered consistently
       assert 
json_content.get("datasources")[0].get("__SqlaTable__").get("database_id") == 1
   ```
   
   to assert the order of the datasource ids but none of the existing dashboard 
fixtures have multiple datasources and I couldnt figure out how to add one with 
multiple datasources.
   
   To manually test prior to this PR:
   
   1. Create multiple datasources in your Superset instance
   2. Create a chart with each datasource
   3. Add both charts to a dashboard
   4. Export the dashboard using the CLI
   5. Make a copy of the exported file
   6. Export again and do a diff on the new vs copied file (you might need to 
export a few times before it changes because the ordering is random)
   
   Following this PR there should never be a diff in the datasources if nothing 
changed.
   
   ### ADDITIONAL INFORMATION
   <!--- Check any relevant boxes with "x" -->
   <!--- HINT: Include "Fixes #nnn" if you are fixing an existing issue -->
   - [x] 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]

Reply via email to