Open
Description
Problem Description
If multiple, overlapping constraints are applied (overlapping on the same column names), SDV may be unable to transform the columns and therefore fall back to reject sampling. When this happens, users will see some errors in the INFO log, which leads to confusion about whether they are adding constraint correctly.
For example, see #1797:
2024-02-19 21:58:25 - INFO - Unable to transform CustomConstraint with columns ['cumu_rain', 'peak_int', 'duration'] due to an error in transform:
'cumu_rain'
Using the reject sampling approach instead.
2024-02-19 21:58:39 - INFO - Unable to transform CustomConstraint with columns ['cumu_rain', 'peak_int', 'duration'] due to an error in transform:
'cumu_rain'
Using the reject sampling approach instead.
Expected behavior
In the docs, we do have this FAQ about how multiple constraints work, but we can provide more guidance on how to troubleshoot constraints in general.
Including:
- Guidance to show the INFO logs (which are off by default)
- What does it mean to have an error in transform? Could mean either (a) there is actually something wrong with the custom constraint logic, or (b) there are multiple, overlapping constraints trying to modify the same column. The latter is not an issue -- SDV is able to work around it
- What can you do for multiple, overlapping constraints? Changing the order may help in some cases