-
Notifications
You must be signed in to change notification settings - Fork 916
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
[MDS] Add Vega support for importing saved objects #6123
Conversation
Signed-off-by: Huy Nguyen <[email protected]>
Signed-off-by: Huy Nguyen <[email protected]>
Signed-off-by: Huy Nguyen <[email protected]>
Signed-off-by: Huy Nguyen <[email protected]>
Signed-off-by: Huy Nguyen <[email protected]>
Signed-off-by: Huy Nguyen <[email protected]>
Signed-off-by: Huy Nguyen <[email protected]>
Signed-off-by: Huy Nguyen <[email protected]>
Signed-off-by: Huy Nguyen <[email protected]>
Signed-off-by: Huy Nguyen <[email protected]>
Signed-off-by: Huy Nguyen <[email protected]>
Signed-off-by: Huy Nguyen <[email protected]>
Signed-off-by: Huy Nguyen <[email protected]>
Signed-off-by: Huy Nguyen <[email protected]>
Signed-off-by: Huy Nguyen <[email protected]>
Signed-off-by: Huy Nguyen <[email protected]>
Signed-off-by: Huy Nguyen <[email protected]>
Signed-off-by: Huy Nguyen <[email protected]>
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #6123 +/- ##
==========================================
+ Coverage 67.25% 67.31% +0.06%
==========================================
Files 3345 3348 +3
Lines 64835 64966 +131
Branches 10432 10465 +33
==========================================
+ Hits 43602 43731 +129
+ Misses 18690 18689 -1
- Partials 2543 2546 +3
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Signed-off-by: Huy Nguyen <[email protected]>
]), | ||
}) | ||
); | ||
}); |
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.
minor: for better coverage, maybe we want to test that savedobjectclient.get have been called? And also test called with expected attributes?
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.
Done, added a test to ensure get()
was called.
]), | ||
}) | ||
); | ||
}); |
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.
same as above
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.
also can we add test for duplicate and undefined data source title?
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.
Since this makes a get
by id, I don't think we need to check for duplicate titles here since there is no ambiguity. The duplicate title check will be done when the visualization is saved and when the visualization is rendered.
Signed-off-by: Huy Nguyen <[email protected]>
Signed-off-by: Huy Nguyen <[email protected]>
Signed-off-by: Huy Nguyen <[email protected]>
Signed-off-by: Huy Nguyen <[email protected]>
* Add MDS support for Vega Signed-off-by: Huy Nguyen <[email protected]> * Refactor field to data_source_id Signed-off-by: Huy Nguyen <[email protected]> * Add to CHANGELOG.md Signed-off-by: Huy Nguyen <[email protected]> * Added test cases and renamed field to use data_source_name Signed-off-by: Huy Nguyen <[email protected]> * Add prefix datasource name test case and add example in default hjson Signed-off-by: Huy Nguyen <[email protected]> * Move CHANGELOG to appropriate section Signed-off-by: Huy Nguyen <[email protected]> * Increased test coverage of search() method Signed-off-by: Huy Nguyen <[email protected]> * Add test cases for util function Signed-off-by: Huy Nguyen <[email protected]> * Add util function to modify Vega Spec Signed-off-by: Huy Nguyen <[email protected]> * Add method to verify Vega saved object type Signed-off-by: Huy Nguyen <[email protected]> * Add import saved object support for Vega Signed-off-by: Huy Nguyen <[email protected]> * Add unit tests for Vega objects in create and conflict modes Signed-off-by: Huy Nguyen <[email protected]> * Refactored utils test file Signed-off-by: Huy Nguyen <[email protected]> * Add to CHANGELOG Signed-off-by: Huy Nguyen <[email protected]> * Use bulkget instead of single get Signed-off-by: Huy Nguyen <[email protected]> * Add datasource references to the specs Signed-off-by: Huy Nguyen <[email protected]> * Fix bootstrap errors Signed-off-by: Huy Nguyen <[email protected]> * Add edge case where title is potentially undefined Signed-off-by: Huy Nguyen <[email protected]> * Address PR comments Signed-off-by: Huy Nguyen <[email protected]> * Add more test coverage for checking conflict Signed-off-by: Huy Nguyen <[email protected]> * Fix unit test Signed-off-by: Huy Nguyen <[email protected]> --------- Signed-off-by: Huy Nguyen <[email protected]> (cherry picked from commit de978d4) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> # Conflicts: # CHANGELOG.md
* Add MDS support for Vega Signed-off-by: Huy Nguyen <[email protected]> * Refactor field to data_source_id Signed-off-by: Huy Nguyen <[email protected]> * Add to CHANGELOG.md Signed-off-by: Huy Nguyen <[email protected]> * Added test cases and renamed field to use data_source_name Signed-off-by: Huy Nguyen <[email protected]> * Add prefix datasource name test case and add example in default hjson Signed-off-by: Huy Nguyen <[email protected]> * Move CHANGELOG to appropriate section Signed-off-by: Huy Nguyen <[email protected]> * Increased test coverage of search() method Signed-off-by: Huy Nguyen <[email protected]> * Add test cases for util function Signed-off-by: Huy Nguyen <[email protected]> * Add util function to modify Vega Spec Signed-off-by: Huy Nguyen <[email protected]> * Add method to verify Vega saved object type Signed-off-by: Huy Nguyen <[email protected]> * Add import saved object support for Vega Signed-off-by: Huy Nguyen <[email protected]> * Add unit tests for Vega objects in create and conflict modes Signed-off-by: Huy Nguyen <[email protected]> * Refactored utils test file Signed-off-by: Huy Nguyen <[email protected]> * Add to CHANGELOG Signed-off-by: Huy Nguyen <[email protected]> * Use bulkget instead of single get Signed-off-by: Huy Nguyen <[email protected]> * Add datasource references to the specs Signed-off-by: Huy Nguyen <[email protected]> * Fix bootstrap errors Signed-off-by: Huy Nguyen <[email protected]> * Add edge case where title is potentially undefined Signed-off-by: Huy Nguyen <[email protected]> * Address PR comments Signed-off-by: Huy Nguyen <[email protected]> * Add more test coverage for checking conflict Signed-off-by: Huy Nguyen <[email protected]> * Fix unit test Signed-off-by: Huy Nguyen <[email protected]> --------- Signed-off-by: Huy Nguyen <[email protected]> (cherry picked from commit de978d4) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> # Conflicts: # CHANGELOG.md Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Ashwin P Chandran <[email protected]>
* Add MDS support for Vega Signed-off-by: Huy Nguyen <[email protected]> * Refactor field to data_source_id Signed-off-by: Huy Nguyen <[email protected]> * Add to CHANGELOG.md Signed-off-by: Huy Nguyen <[email protected]> * Added test cases and renamed field to use data_source_name Signed-off-by: Huy Nguyen <[email protected]> * Add prefix datasource name test case and add example in default hjson Signed-off-by: Huy Nguyen <[email protected]> * Move CHANGELOG to appropriate section Signed-off-by: Huy Nguyen <[email protected]> * Increased test coverage of search() method Signed-off-by: Huy Nguyen <[email protected]> * Add test cases for util function Signed-off-by: Huy Nguyen <[email protected]> * Add util function to modify Vega Spec Signed-off-by: Huy Nguyen <[email protected]> * Add method to verify Vega saved object type Signed-off-by: Huy Nguyen <[email protected]> * Add import saved object support for Vega Signed-off-by: Huy Nguyen <[email protected]> * Add unit tests for Vega objects in create and conflict modes Signed-off-by: Huy Nguyen <[email protected]> * Refactored utils test file Signed-off-by: Huy Nguyen <[email protected]> * Add to CHANGELOG Signed-off-by: Huy Nguyen <[email protected]> * Use bulkget instead of single get Signed-off-by: Huy Nguyen <[email protected]> * Add datasource references to the specs Signed-off-by: Huy Nguyen <[email protected]> * Fix bootstrap errors Signed-off-by: Huy Nguyen <[email protected]> * Add edge case where title is potentially undefined Signed-off-by: Huy Nguyen <[email protected]> * Address PR comments Signed-off-by: Huy Nguyen <[email protected]> * Add more test coverage for checking conflict Signed-off-by: Huy Nguyen <[email protected]> * Fix unit test Signed-off-by: Huy Nguyen <[email protected]> --------- Signed-off-by: Huy Nguyen <[email protected]> (cherry picked from commit de978d4) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> # Conflicts: # CHANGELOG.md Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Ashwin P Chandran <[email protected]> (cherry picked from commit d144637) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
…6222) * Add MDS support for Vega * Refactor field to data_source_id * Add to CHANGELOG.md * Added test cases and renamed field to use data_source_name * Add prefix datasource name test case and add example in default hjson * Move CHANGELOG to appropriate section * Increased test coverage of search() method * Add test cases for util function * Add util function to modify Vega Spec * Add method to verify Vega saved object type * Add import saved object support for Vega * Add unit tests for Vega objects in create and conflict modes * Refactored utils test file * Add to CHANGELOG * Use bulkget instead of single get * Add datasource references to the specs * Fix bootstrap errors * Add edge case where title is potentially undefined * Address PR comments * Add more test coverage for checking conflict * Fix unit test --------- (cherry picked from commit de978d4) # Conflicts: # CHANGELOG.md (cherry picked from commit d144637) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Ashwin P Chandran <[email protected]>
Description
This PR adds (limited) support for importing Vega saved objects when
data_source.enabled: true
and when specifying a datasource. Support in this case means:create
mode or inoverwrite
modecreate
mode or inoverwrite
modeLimitations:
data_source_name
can be changed; if users have multipledata_source_names
specified in their Vega spec, the origin datasource name will be changed but the others will stay the sameIssues Resolved
Closes #5927
Screenshot
When updating the
data_source_name
s, the datasource references also change. In this recording,Data Source A
is updated toData Source B
Screen.Recording.2024-03-15.at.7.48.07.PM.mov
Importing a similar visualization that references
Data Source B
and has a local query will update the spec to includeData Source A
in the old local queries.Data Source A
is also shown to be added as a referenceScreen.Recording.2024-03-15.at.8.31.20.PM.mov
Screen.Recording.2024-03-12.at.1.11.02.PM.mov
Testing the changes
The following scenarios were tested:
data_source_name
and the references will append this new datasource id)Check List
yarn test:jest
yarn test:jest_integration