You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In a test config , we can assign custom failure calculation with fail_calc. Suppose, with the custom failure calculation, we want to identify the number of records that have failed the test, we can just set fail_calc: count(*), which is the default behaviour. Now instead of the number, we want the proportion of records that have failed, with a similar logic we can set fail_calc: count(*) / (select count(*) as total_records from dataset_name`.`table_name`). But doing so, results in a error:
0.00125 is not of type 'integer'
Failed validating 'type' in schema['properties']['failures']:
{'type': 'integer'}
On instance['failures']:
0.00125
A user should have an option to return failures of type float instead of the type integer constraint.
Workaround: convert float to integer by modifying it to a percentage.
The text was updated successfully, but these errors were encountered:
Hey @rahulbaid, thanks for submitting this! We believe in having the failure be the count of failed records hence the int constrain. To make sure I understand your purpose correctly, you would want the test to warn/fail if a certain percentage of records doesn't meet requirements right? There's an improvement we want to add that looks like this
which would be able to config warning/failure based on percentage but still keep the same failures as int. This is not implemented yet but I am wondering will this feature resolve your issue?
Also, this is the code where that int constrain is being defined.
Is there an existing feature request for this?
Describe the Feature
In a test
config
, we can assign custom failure calculation withfail_calc
. Suppose, with the custom failure calculation, we want to identify the number of records that have failed the test, we can just setfail_calc: count(*)
, which is the default behaviour. Now instead of the number, we want the proportion of records that have failed, with a similar logic we can setfail_calc: count(*) / (select count(*) as total_records from dataset_name`.`table_name`)
. But doing so, results in a error:A user should have an option to return
failures
of typefloat
instead of the typeinteger
constraint.Workaround: convert
float
tointeger
by modifying it to a percentage.The text was updated successfully, but these errors were encountered: