Repository navigation
feat: TreeMap migration - #20346
feat: TreeMap migration#20346
Conversation
Codecov Report
@@ Coverage Diff @@
## master #20346 +/- ##
==========================================
- Coverage 66.71% 66.68% -0.04%
==========================================
Files 1752 1753 +1
Lines 65478 65710 +232
Branches 6916 6940 +24
==========================================
+ Hits 43681 43816 +135
- Misses 20049 20132 +83
- Partials 1748 1762 +14
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Use integration test database instance for local debugging.
7b4e0dc to
9e44fa0
Compare
There was a problem hiding this comment.
Maybe have separated tests for upgrade and downgrade?
There was a problem hiding this comment.
the method of downgrade needs an updated slice so combine upgrade and downgrade in the same unit test case.
There was a problem hiding this comment.
Maybe move MigrateTreeMap to its own file? I guess we'll have a bunch of these.
There was a problem hiding this comment.
This is a one-time script. There is no need to split moudles.
There was a problem hiding this comment.
Won't we have other viz types to be migrated? If yes, are you going to add all the viz types to this file?
There was a problem hiding this comment.
yep, all migrations are placed in this script.
There was a problem hiding this comment.
Generally, scripts are waterfalls, while libary should be modular.
There was a problem hiding this comment.
I personally find this more readable, but it's not a blocker.
| if key in self.mapping_keys and self.mapping_keys[key] in rv_data: | |
| raise ValueError("Duplicate key in target viz") | |
| if key in self.mapping_keys: | |
| rv_data[self.mapping_keys[key]] = value | |
| if key in self.mapping_keys: | |
| mapped_key = self.mapping_keys[key] | |
| if mapped_key in rv_data: | |
| raise ValueError("Duplicate key in target viz") | |
| rv_data[mapped_key] = value |
There was a problem hiding this comment.
Exception handling is easier to maintain if it can be put together.
b2daecf to
0d10fb3
Compare
|
@zhaoyongjie @rusackas Shouldn't we disable TreeMap v1 after the migration? By that, I mean no more TreeMap v1 on Add Slice and Chart Type filter in the charts list. Right now, the user can still create the old version which kind of defeats the whole purpose of the migration. |
I intend to do a separated PR that removes the Legacy TreeMap after merged migration PR. the follow-up PR will 1) remove Legacy TreeMap from plugins, 2) remove legacy TreeMap from MainPresent.js. |
May I suggest implementing this in the same PR to avoid the risk of someone executing the script and creating an old TreeMap before the follow-up PR is merged? |
|
@john-bodley thanks for the reviewing, I have addressed comments. |

SUMMARY
This PR intends to introduce an approach that migrates from v1 viz to v2 viz. The first PR implement TreeMap migration.
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
N/A
TESTING INSTRUCTIONS
ADDITIONAL INFORMATION