Skip to content
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

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

SuZhou-Joe
Copy link
Member

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

image

After

20250108162451031.mp4

Testing the changes

Changelog

  • fix: Disable query assistant when dataset type is not supported

Check List

  • All tests pass
    • yarn test:jest
    • yarn test:jest_integration
  • New functionality includes testing.
  • New functionality has been documented.
  • Update CHANGELOG.md
  • Commits are signed per the DCO using --signoff

Copy link

codecov bot commented Jan 8, 2025

Codecov Report

Attention: Patch coverage is 80.00000% with 1 line in your changes missing coverage. Please review.

Project coverage is 61.01%. Comparing base (82689bb) to head (7dd4509).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...nts/public/query_assist/utils/create_extension.tsx 80.00% 0 Missing and 1 partial ⚠️
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     
Flag Coverage Δ
Linux_1 29.07% <ø> (ø)
Linux_2 56.45% <ø> (ø)
Linux_3 38.03% <ø> (ø)
Linux_4 29.03% <80.00%> (+<0.01%) ⬆️
Windows_1 29.09% <ø> (ø)
Windows_2 56.40% <ø> (ø)
Windows_3 38.03% <ø> (+<0.01%) ⬆️
Windows_4 29.03% <80.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

ruanyl
ruanyl previously approved these changes Jan 8, 2025
isEnabled$: (dependencies) => {
const query = dependencies.query;
if (!queryAssistantSupportedDatasetTypes.includes(query.dataset?.type || '')) {
return new BehaviorSubject(false);
Copy link
Member

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:

Suggested change
return new BehaviorSubject(false);
return of(false);

Copy link
Member Author

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]>
@SuZhou-Joe SuZhou-Joe changed the title [Enhancement] Disable query assistant when dataset type is not supported Disable query assistant when dataset type is not supported Jan 9, 2025
@@ -93,6 +93,11 @@ const getAvailableLanguages$ = (http: HttpSetup, data: DataPublicPluginSetup) =>
})
);

const queryAssistantSupportedDatasetTypes = [
DEFAULT_DATA.SET_TYPES.INDEX,
DEFAULT_DATA.SET_TYPES.INDEX_PATTERN,
Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants