-
Notifications
You must be signed in to change notification settings - Fork 924
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
Disable query assistant when dataset type is not supported #9157
base: main
Are you sure you want to change the base?
Disable query assistant when dataset type is not supported #9157
Conversation
Signed-off-by: SuZhou-Joe <[email protected]>
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #9157 +/- ##
=======================================
Coverage 61.01% 61.01%
=======================================
Files 3812 3812
Lines 91385 91389 +4
Branches 14438 14439 +1
=======================================
+ Hits 55762 55765 +3
- Misses 32065 32111 +46
+ Partials 3558 3513 -45
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
isEnabled$: (dependencies) => { | ||
const query = dependencies.query; | ||
if (!queryAssistantSupportedDatasetTypes.includes(query.dataset?.type || '')) { | ||
return new BehaviorSubject(false); |
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.
Nit: what about simply do:
return new BehaviorSubject(false); | |
return of(false); |
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.
Sure, updated.
Signed-off-by: SuZhou-Joe <[email protected]>
Signed-off-by: SuZhou-Joe <[email protected]>
@@ -93,6 +93,11 @@ const getAvailableLanguages$ = (http: HttpSetup, data: DataPublicPluginSetup) => | |||
}) | |||
); | |||
|
|||
const queryAssistantSupportedDatasetTypes = [ | |||
DEFAULT_DATA.SET_TYPES.INDEX, | |||
DEFAULT_DATA.SET_TYPES.INDEX_PATTERN, |
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.
thanks for doing this but should this be apart of the switch map on line 87
Description
Discover with query enhancement now supports varies of dataset: INDEX_PATTERN / INDEXES / S3, while the PPL query generated by query assistant are only supported by opensearch engine, so that we need to disable query assistant for S3 dataset for now.
Issues Resolved
Screenshot
Before
After
20250108162451031.mp4
Testing the changes
Changelog
Check List
yarn test:jest
yarn test:jest_integration