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

Add setting to turn extending numeric precision on or off #8837

Merged
merged 2 commits into from
Dec 20, 2024

Conversation

AMoo-Miki
Copy link
Collaborator

@AMoo-Miki AMoo-Miki commented Nov 9, 2024

Description

Add setting to turn extending numeric precision on or off

Screenshot

Screenshot 2024-11-08 at 16-58-25 OpenSearch Dashboards

Changelog

  • feat: Add setting to turn extending numeric precision on or off

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 Nov 9, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 60.90%. Comparing base (f06a478) to head (407d41e).
Report is 6 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #8837      +/-   ##
==========================================
+ Coverage   60.86%   60.90%   +0.03%     
==========================================
  Files        3808     3808              
  Lines       91209    91212       +3     
  Branches    14410    14410              
==========================================
+ Hits        55514    55550      +36     
+ Misses      32154    32108      -46     
- Partials     3541     3554      +13     
Flag Coverage Δ
Linux_1 29.02% <0.00%> (-0.01%) ⬇️
Linux_2 56.38% <0.00%> (-0.01%) ⬇️
Linux_3 37.99% <100.00%> (?)
Linux_4 29.01% <0.00%> (-0.01%) ⬇️
Windows_1 29.03% <0.00%> (-0.01%) ⬇️
Windows_2 56.34% <0.00%> (-0.01%) ⬇️
Windows_3 38.00% <100.00%> (+0.06%) ⬆️
Windows_4 29.01% <0.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.

AMoo-Miki pushed a commit to AMoo-Miki/OpenSearch-Dashboards that referenced this pull request Nov 10, 2024
opensearch-changeset-bot bot added a commit to AMoo-Miki/OpenSearch-Dashboards that referenced this pull request Nov 10, 2024
@@ -108,4 +108,5 @@ export const UI_SETTINGS = {
QUERY_DATAFRAME_HYDRATION_STRATEGY: 'query:dataframe:hydrationStrategy',
SEARCH_QUERY_LANGUAGE_BLOCKLIST: 'search:queryLanguageBlocklist',
NEW_HOME_PAGE: 'home:useNewHomePage',
DATA_WITH_LONG_NUMERALS: 'data:withLongNumerals',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: i think i originally did data as well. but then was convinced to use search because then we can group it with the search category. not a strong opinion on this though

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I locked in on data because this is queried by functionality not limited to search.

kavilla
kavilla previously approved these changes Nov 16, 2024
kavilla
kavilla previously approved these changes Nov 16, 2024
Copy link
Member

@kavilla kavilla left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry my pr caused a conflict on this pr so i just fixed it on github. do you mind verifying miki it's all good?

also one thing i think we should do is move this to the workspace setting or even better yet allow for request options from the query editor would make life a lot easier for developers vs an advanced setting to toggle percision or not

@AMoo-Miki
Copy link
Collaborator Author

sorry my pr caused a conflict on this pr so i just fixed it on github. do you mind verifying miki it's all good?

Thanks. Didn't see anything glaring.

also one thing i think we should do is move this to the workspace setting or even better yet allow for request options from the query editor would make life a lot easier for developers vs an advanced setting to toggle percision or not

Requests can choose to ignore or entertain the precision setting. I do see value for this to ALSO be in the workspace setting since not all users will have workspaces enabled. Will have to see how values are inherited from config and advanced settings to the workspace (later). Thanks for the suggestion.

joshuali925
joshuali925 previously approved these changes Nov 29, 2024
Copy link
Member

@joshuali925 joshuali925 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nothing blocking

notifications.toasts,
trackUiMetric,
history,
uiSettings,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

uiSettings is a service, would it ever change?

Copy link
Collaborator Author

@AMoo-Miki AMoo-Miki Dec 17, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Most of these are; not sure if it is because useServicesContext can throw (which would prevent code advancing here), linting rules, or something else but most of the services fetched from the context are passed in here too. Didn't want to re-engineer this section so followed the same pattern for consistency.

value: true,
description: i18n.translate('data.advancedSettings.data.withLongNumeralsText', {
defaultMessage:
"Turn on for precise handling of extremely large numbers. Turn off to optimize performance when high precision for large values isn't required.",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should this tell user what the threshold is before losing precision?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be too wordy. Instead, I will have this added to the documentation website with proper explanation.

@AMoo-Miki AMoo-Miki dismissed stale reviews from joshuali925 and kavilla via 407d41e December 17, 2024 18:03
Copy link
Collaborator

@virajsanghvi virajsanghvi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code lgtm, although does look like there are some failures?

@AMoo-Miki
Copy link
Collaborator Author

@virajsanghvi thanks; just flaky test.

@AMoo-Miki AMoo-Miki merged commit 791f5d8 into opensearch-project:main Dec 20, 2024
68 of 69 checks passed
opensearch-trigger-bot bot pushed a commit that referenced this pull request Dec 20, 2024
* Add setting to turn extending numeric precision on or off

Signed-off-by: Miki <[email protected]>

* Changeset file for PR #8837 created/updated

---------

Signed-off-by: Miki <[email protected]>
Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com>
(cherry picked from commit 791f5d8)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
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.

4 participants