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

fix: Correct the percentile values passed to the percentile function in DescriptiveStats for the index describe command #4136

Merged

Conversation

unpervertedkid
Copy link
Contributor

@unpervertedkid unpervertedkid commented Nov 14, 2023

Description

This PR corrects the percentile values passed to the percentile function in the DescriptiveStats struct. Previously, the percentiles were incorrectly set as 1, 50, 50, 75, and 75. This PR changes these values to correctly represent the 1st, 25th, 50th, 75th, and 99th percentiles.

How was this PR tested?

This PR was tested by running the existing unit tests for the DescriptiveStats struct. Additionally, manual testing was performed by generating statistics for a sample dataset and verifying that the outputted percentiles were correct.

More assertions were added to prevent the same issue from recurring in the future.

@CLAassistant
Copy link

CLAassistant commented Nov 14, 2023

CLA assistant check
All committers have signed the CLA.

@guilload
Copy link
Member

Would you mind improving the test_descriptive_stats() test in this PR?

@unpervertedkid
Copy link
Contributor Author

@guilload am still figuring my way around the codebase, could you help point me in the right direction, I am assuming you mean add assertions that should catch similar errors in the future?

Copy link
Member

@guilload guilload left a comment

Choose a reason for hiding this comment

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

You got it right! Remove the unnecessary line and we should be good.

quickwit/quickwit-cli/src/index.rs Outdated Show resolved Hide resolved
@guilload
Copy link
Member

guilload commented Nov 14, 2023

You can run make fmt to fix the formatting issues.
You can run make fix to fix some of the linting issues.
You can run make test-all to test the entire project.

You can run cargo test --manifest-path quickwit/Cargo.toml -p quickwit-common to test a single crate.

-> Contributing guidelines

@unpervertedkid unpervertedkid changed the title (Bug) Correct the percentile values passed to the percentile function in DescriptiveStats for the index describe command fix: Correct the percentile values passed to the percentile function in DescriptiveStats for the index describe command Nov 18, 2023
@unpervertedkid
Copy link
Contributor Author

@guilload Should be good now.

@guilload guilload merged commit 205fab0 into quickwit-oss:main Nov 18, 2023
3 checks passed
@guilload
Copy link
Member

Thanks @unpervertedkid !

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

Successfully merging this pull request may close these issues.

3 participants