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 Permitted Value for Expression Type Rules #36

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

goodwillpunning
Copy link
Contributor

This commit corrects a display-only bug in the validation results when expression type Rules are used. Previously, the permitted column would display the Rule expression as a String. This commit updates the permitted column to the evaluated expression.

This commit also removes an unused object, Lookups.

Copy link
Contributor

@GeekSheikh GeekSheikh left a comment

Choose a reason for hiding this comment

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

@goodwillpunning Do we have any tests on the output reports? I didn't see any changes to tests that change the actual/permitted values. Did I just miss them?

@@ -48,7 +48,7 @@ class Validator(ruleSet: RuleSet, detailLvl: Int) extends SparkSessionWrapper {
struct(
lit(rule.ruleName).alias("ruleName"),
(rule.inputColumn === rule.validExpr).alias("passed"),
lit(rule.inputColumnName).alias("permitted"),
rule.inputColumn.cast("string").alias("permitted"),
Copy link
Contributor

Choose a reason for hiding this comment

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

Here I was expecting there to be the following columns.
ruleName - good
passed - good
logic - not present. This should be the SQL expr used to derive the "permitted"
permitted - allowed value or range
actual - the result of the expression value

@CLAassistant
Copy link

CLAassistant commented Nov 27, 2023

CLA assistant check
All committers have signed the CLA.

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

Copy link

codecov bot commented Nov 27, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (ef9b9fa) 87.50% compared to head (fc4bfc9) 89.63%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master      #36      +/-   ##
==========================================
+ Coverage   87.50%   89.63%   +2.13%     
==========================================
  Files           5        5              
  Lines         168      164       -4     
  Branches        3        4       +1     
==========================================
  Hits          147      147              
+ Misses         21       17       -4     

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

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