Open
Description
Problem Description
As a user, I want only the relevant errors surfaced to me and expected behavior to be suppressed.
For now, focus on the KS Test metric (see #129 and #130 for more details)
Expected behavior
- Create a new
MetricComputationError
to be used when there is a mathematical error when computing the metric (eg. when calling scipy or dividing by zero)
For tabular and relational tests compute
method:
- If there are 0 columns with valid data types, return
None
and throw a warning. This is not an error; the metric is simply undefined.
>>> InvertedKSTest.compute(real_data, synthetic_data, metadata)
Warning: Incompatible data types. The InvertedKSTest is only defined for column types ['datetime', 'numerical']. None were found in the data.
None
- If the entire test is resulting in mathematical errors (eg all results are invalid), throw a
MetricComputationError
>>> InvertedKSTest.compute(real_data, synthetic_data, metadata)
MetricComputationError: <message>
- However, if only certain columns are returning a
MetricComputationError
, show a warning but keep going with the other columns
>>> InvertedKSTest.compute(real_data, synthetic_data, metadata)
Warning: InvertedKSTest returned a MetricComputationError for column 'user_age'. Skipping this column.
Warning: InvertedKSTest returned a MetricComputationError for column 'weight'. Skipping this column.
0.699382