New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: freeze the UUID of examples DB #15724
Conversation
b9aff5e
to
0a4bc13
Compare
@@ -73,4 +73,4 @@ columns: | |||
description: null | |||
python_date_format: null | |||
version: 1.0.0 | |||
database_uuid: 566ca280-3da8-967e-4aa4-4b349218736a | |||
database_uuid: a2dc77af-e654-49bb-b321-40f6b559a1ee |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Other datasets inside superset/examples/configs/datasets/examples
already had the UUID set to this, so I kept it and updated this one.
Codecov Report
@@ Coverage Diff @@
## master #15724 +/- ##
==========================================
+ Coverage 76.91% 76.94% +0.02%
==========================================
Files 983 983
Lines 51583 51641 +58
Branches 6979 6994 +15
==========================================
+ Hits 39673 39733 +60
+ Misses 11688 11682 -6
- Partials 222 226 +4
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
0a4bc13
to
02b5057
Compare
02b5057
to
83e6e0c
Compare
NB: We're here discussing the `import-dashboards` CLI with the `VERSIONED_EXPORT` feature flag *turned ON* — cf. apache#11349 Currently, `superset import-dashboards` looks up at the required databases (`export/databases/*.yaml`). If the db URI (`sqlalchemy_uri` key) contains a masked password, then the script looks up for already existing databases record. The match is currently done using db UUID. However, '<insert how UUIDs are generated>', the same db connection (same URI) might not have the same UUID on the export instance, and on the import one. (Cf. apache#16395) Thus, we propose to lookup for the db _name_ instead — this would also allow for updating the db URI between the export and the import instance. Note: this change should not be propagated for the demo db, as its UUID has been frozen in apache#15724. Signed-off-by: Étienne Boisseau-Sierra <etienne.boisseau-sierra@unipart.io>
SUMMARY
Currently when we run
load-examples
the examples DB is created with a random UUID. This makes it hard to move across instances datasets/charts/dashboards that reference the examples DB, since the UUID doesn't match.This PR freezes the UUID of the examples DB.
There's one gotcha. If the user has created the examples DB before this PR, but runs
load-examples
after this patch we won't find the examples DB by searching for the frozen UUID. Instead, we need to search by name. This is how currently theload-examples
process works. I kept the logic for when we can't find the examples DB via the UUID.BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
Loaded examples:
Then checked the UUID of the examples DB created:
TESTING INSTRUCTIONS
ADDITIONAL INFORMATION