-
Notifications
You must be signed in to change notification settings - Fork 31
Adding unit tests and test reporting to the dataframe-rules-engine #6
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
Conversation
added ruletype enum to make it easier to manage rule types for testing added entry to contributing.md on how to submit pull requests added information to readme on how to run tests altered gitignore to include plugins.sbt which is for jacoco test reports altered build.sbt to include jacoco test reporting & added scalatest added 6 tests regarding validation.
|
@GeekSheikh let me know what you think 😄 |
|
Will review ASAP. Thank you! |
|
Hey, Sri, This is great, thanks for building up the scaffolding and throwing in a few tests. If you get some time, could you review this PR? It fixed a bug with the output report, if you get time, please add some additional tests to validate the output df. Also, is the coverage sufficient for all the tests without explicitly doing the test with a group by and without a group by? I saw the validations on the group by cols, but not 100% sure that covers all cases. We also need to add an agg column in each test to validate the agg expressions vs simple column expressions. We also need to add a test for a complex column to each test case such as I believe these would be simple, quick additions, do you think you will have time to add them soon? Appreciate the contribution. Summary
|
…rame-rules-engine into issue-5
…ered issue with complex type
…all the appropriate tests
GeekSheikh
left a comment
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.
Great work. Made a few changes and added some docs. Thanks so much for getting the test suite started.
| } | ||
|
|
||
| test("The input rule should have 3 invalid count for MinMax_Scan_Price_Minus_Retail_Price_min for failing complex type.") { | ||
| val expectedDF = Seq( |
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.
@stikkireddy -- Changing this, this is not correct. Since each row of Retail_Price - Scan Price evaluates to -1, both the Min and max rules should fail as the min and the max both are -1 which violates the lower bound rule of 0.0. Additionally, aggregate InvalidCounts always evaluate to 0 or 1 since the min/max results in a single value for an entire column thus the sum of a single value (1) cannot > 1.
Aggregate columns return an invalid count of 1 or 0
Non-aggregate expression return the sum on invalids
added jacoco plugin into sbt
added ruletype enum to make it easier to manage rule types for testing
added entry to contributing.md on how to submit pull requests
added information to readme on how to run tests
altered gitignore to include plugins.sbt which is for jacoco test reports
altered build.sbt to include jacoco test reporting & added scalatest
added 6 tests regarding validation.