Cannot use any scalar constraint (ScalarRange
, ScalarInequality
) with datetime columns that are stored as ints
#2324
Labels
ScalarRange
, ScalarInequality
) with datetime columns that are stored as ints
#2324
Environment Details
Error Description
In some cases, I may have a datetime column (listed as sdtype datetime in my metadata) that is stored as an integer. Eg:
2024, 2023, ...
YYYYMMMDD
format), so the column would contain integers such as20240101, 20231231, ...
In such cases, I am able to generally fit and sample synthetic data. However, if I try adding any of the scalar constraints (
ScalarRange
,ScalarInequality
), then I get anInvalidConstraintsError
when I try to add the constraint to my synthesizer.Steps to reproduce
Output:
Workaround
Currently, these constraints are set up to assume that datetime values must always be represented as strings. So a simple workaround would be to cast the relevant column to a string and then supply the constraint values as strings too.
Other Info
ScalarRange
orScalarInequality
constraint is absolutely needed. By default, all SDV synthesizers will enforce the min/max values that are observed in the data. If this default is kept, then you do not need to add any constraints.The text was updated successfully, but these errors were encountered: