Skip to content

Commit

Permalink
[CONTRIB] ExpectColumnValuesToBePresentInOtherTable - Wording update (#…
Browse files Browse the repository at this point in the history
…9151)

Co-authored-by: JennyTee <[email protected]>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
3 people authored Dec 21, 2023
1 parent 031d100 commit 3ff2c58
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ def _prescriptive_renderer(

template_dict = configuration.kwargs.get("template_dict")

template_str = "All values in column $foreign_key_column are present in column $primary_key_column_in_foreign_table of table $foreign_table. (Observed Value is the number of missing values)."
template_str = "All values in column $foreign_key_column are present in column $primary_key_column_in_foreign_table of table $foreign_table."

params = {
"foreign_key_column": template_dict["foreign_key_column"],
Expand Down Expand Up @@ -163,7 +163,10 @@ def _validate(
self._validate_template_dict(configuration)
final_value = metrics.get("query.template_values")[0]["COUNT(1)"]
return ExpectationValidationResult(
success=(final_value == 0), result={"observed_value": final_value}
success=(final_value == 0),
result={
"observed_value": f"{final_value} missing item{'s' if final_value != 1 else ''}"
},
)

examples = [
Expand Down

0 comments on commit 3ff2c58

Please sign in to comment.