-
Notifications
You must be signed in to change notification settings - Fork 890
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
Support injecting DataStructureMeta
from QueryEditorExtensions
for Query Assist
#7871
Conversation
Signed-off-by: Joshua Li <[email protected]>
Signed-off-by: Joshua Li <[email protected]>
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #7871 +/- ##
==========================================
- Coverage 64.22% 64.21% -0.02%
==========================================
Files 3672 3673 +1
Lines 81152 81175 +23
Branches 12938 12940 +2
==========================================
+ Hits 52121 52127 +6
- Misses 25822 25840 +18
+ Partials 3209 3208 -1
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: Joshua Li <[email protected]>
5a88864
to
555c299
Compare
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.
The code looks good. Looks like you have a failing unit test though.
* @returns list of query assist supported languages for the given data source. | ||
*/ | ||
const getAvailableLanguagesForDataSource = (() => { | ||
const availableLanguagesByDataSource: Map<string | undefined, string[]> = new Map(); |
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.
Nice way to cache the data
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.
Not a blocker but can we add some tests for this function?
* @param selectDataSourceId - function to get data source id given a data structure | ||
* @returns data structures with meta | ||
*/ | ||
export const injectMetaToDataStructures = async ( |
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.
@ashwin-pc are we sure we don't want to do convert the dataset config to a class.
I was thinking it would be similar to the the interceptor class:
This way we don't have to ensure developers import this in their configs.
@joshuali925 could implement this in the base class and then it would be available for classes that extend the base class
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.
agree. will think about it later, right now just trying to add instead of refactor..
@@ -95,7 +95,7 @@ export class QueryEnhancementsPlugin | |||
queryString.getLanguageService().registerLanguage(sqlLanguageConfig); | |||
|
|||
data.__enhance({ | |||
ui: { | |||
editor: { |
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.
sorry about that. Thanks for fixing.
9bc2433
into
opensearch-project:main
…r Query Assist (#7871) * fix query editor extensions enhance key Signed-off-by: Joshua Li <[email protected]> * add query assist icons to clusters if available Signed-off-by: Joshua Li <[email protected]> * allow custom icon for `DATA_STRUCTURE_META_TYPES.FEATURE` Signed-off-by: Joshua Li <[email protected]> * Changeset file for PR #7871 created/updated --------- Signed-off-by: Joshua Li <[email protected]> Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com> Co-authored-by: Ashwin P Chandran <[email protected]> (cherry picked from commit 9bc2433) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
…r Query Assist (#7871) (#7888) * fix query editor extensions enhance key * add query assist icons to clusters if available * allow custom icon for `DATA_STRUCTURE_META_TYPES.FEATURE` * Changeset file for PR #7871 created/updated --------- (cherry picked from commit 9bc2433) Signed-off-by: Joshua Li <[email protected]> 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: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com> Co-authored-by: Ashwin P Chandran <[email protected]>
Description
TODO items:
OpenSearch-Dashboards/src/plugins/data/common/datasets/types.ts
Lines 137 to 161 in 73339c5
type
toTYPE
, which should be "metadata for dataset type". But for extensions I thinkFEATURE
would make more sense. Is it on purpose to only support built-in OUI icons forFEATURE
?CUSTOM
, is it intentional to not support icons for it?Issues Resolved
Screenshot
Testing the changes
Changelog
DataStructureMeta
fromQueryEditorExtensions
for Query AssistCheck List
yarn test:jest
yarn test:jest_integration