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

New analyzer, RatioOfSums #552

Merged
merged 5 commits into from
Apr 11, 2024
Merged

Conversation

scott-gunn
Copy link
Contributor

Issue #, if available:

Description of changes:
This PR creates a new analyzer called RatioOfSums. It aggregates and sums 2 separate columns, then divides them.

For example, imagine a baseball dataset that contains hits and total at-bats, with a row for every player in every game. If a player's batting average (total hits/total at-bats) changes by more than 0.2 in one week, an error or warning could be given. Another example is a % of total calculation in a table that has many rows with facts val1, val2, val3, total, and we want to ensure that val1's percent of the total doesn't change more than X in a given time period.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@akalotkin
Copy link
Contributor

@rdsharma26, could you take a look at this PR, please?

@rdsharma26
Copy link
Contributor

Thanks @akalotkin for the PR. Can you add the copyright header to the new file, in order to unblock the build?

@scott-gunn
Copy link
Contributor Author

@rdsharma26 The copyright has been added.

@rdsharma26
Copy link
Contributor

Thank you. The changes look good and we are internally reviewing as well. We will get back to you by tomorrow.

Copy link
Contributor

@mentekid mentekid left a comment

Choose a reason for hiding this comment

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

Thanks for the contribution - I am merging your change.

In the future, it would be interesting to implement this for any type of aggregation, not just sum. We could support aggregations like average to make this more generic.

@mentekid mentekid merged commit 5cf0837 into awslabs:master Apr 11, 2024
1 check passed
@mentekid
Copy link
Contributor

Opened this to track
#556

rdsharma26 pushed a commit that referenced this pull request Apr 16, 2024
* Added RatioOfSums analyzer and tests

* Unit test for divide by zero and code cleanup.

* More detailed Scaladoc

* Fixed docs to include Double.NegativeInfinity

* Add copyright to new file
rdsharma26 pushed a commit that referenced this pull request Apr 16, 2024
* Added RatioOfSums analyzer and tests

* Unit test for divide by zero and code cleanup.

* More detailed Scaladoc

* Fixed docs to include Double.NegativeInfinity

* Add copyright to new file
rdsharma26 pushed a commit that referenced this pull request Apr 16, 2024
* Added RatioOfSums analyzer and tests

* Unit test for divide by zero and code cleanup.

* More detailed Scaladoc

* Fixed docs to include Double.NegativeInfinity

* Add copyright to new file
rdsharma26 pushed a commit that referenced this pull request Apr 17, 2024
* Added RatioOfSums analyzer and tests

* Unit test for divide by zero and code cleanup.

* More detailed Scaladoc

* Fixed docs to include Double.NegativeInfinity

* Add copyright to new file
rdsharma26 pushed a commit that referenced this pull request Apr 17, 2024
* Added RatioOfSums analyzer and tests

* Unit test for divide by zero and code cleanup.

* More detailed Scaladoc

* Fixed docs to include Double.NegativeInfinity

* Add copyright to new file
shriyavanvari pushed a commit that referenced this pull request May 2, 2024
* Added RatioOfSums analyzer and tests

* Unit test for divide by zero and code cleanup.

* More detailed Scaladoc

* Fixed docs to include Double.NegativeInfinity

* Add copyright to new file
shriyavanvari pushed a commit that referenced this pull request May 2, 2024
* Added RatioOfSums analyzer and tests

* Unit test for divide by zero and code cleanup.

* More detailed Scaladoc

* Fixed docs to include Double.NegativeInfinity

* Add copyright to new file
arsenalgunnershubert777 pushed a commit to arsenalgunnershubert777/deequ that referenced this pull request Nov 8, 2024
* Added RatioOfSums analyzer and tests

* Unit test for divide by zero and code cleanup.

* More detailed Scaladoc

* Fixed docs to include Double.NegativeInfinity

* Add copyright to new file
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.

4 participants