Skip to content

fix: return NOT_EVALUATED for missing_percent when filter produces zero rows (#2407)#2673

Open
devimano2011 wants to merge 2 commits into
sodadata:mainfrom
devimano2011:fix/2407-missing-percent-zero-row-count
Open

fix: return NOT_EVALUATED for missing_percent when filter produces zero rows (#2407)#2673
devimano2011 wants to merge 2 commits into
sodadata:mainfrom
devimano2011:fix/2407-missing-percent-zero-row-count

Conversation

@devimano2011

Copy link
Copy Markdown

fix: skip missing_percent check when filter produces zero rows (#2407)When a filter removes all rows (row_count=0), missing_percent was returning 0.0 which incorrectly failed checks like 'fail when < 100'. Added a guard that returns NOT_EVALUATED when row_count is 0, which is semantically correct: there are no rows to evaluate.

Description

Please provide a description of your changes:

  • What problem are you solving?
  • Any expected impact on downstream packages/services?
  • Reference issue # if available.

Checklist

  • I added a test to verify the new functionality.
  • I verified this PR does not break soda-extensions.

fix: skip missing_percent check when filter produces zero rows (sodadata#2407)When a filter removes all rows (row_count=0), missing_percent was returning 0.0 which incorrectly failed checks like 'fail when < 100'. Added a guard that returns NOT_EVALUATED when row_count is 0, which is semantically correct: there are no rows to evaluate.
@CLAassistant

Copy link
Copy Markdown

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.

fix: move missing_percent assignment before row_count guard (SonarCloud)SonarCloud flagged 'missing_percent used before defined' on line 92. Fixed by moving the missing_percent assignment to before the row_count == 0 guard so all variables are defined before they are referenced.
@sonarqubecloud

Copy link
Copy Markdown

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.

2 participants