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
Please indicate the following details about the environment in which you found the bug:
SDV version: 0.12.0
Python version: 3.8.8
Operating System: Windows
Error Description
ConstraintsNotMetError is raised when trying to use GreaterThan constraint with datetime.
Steps to reproduce
I have included a working example using sdv demo dataset
from sdv.demo import load_tabular_demo
from sdv.constraints import GreaterThan
data = load_tabular_demo('student_placements')
start_constraint = GreaterThan(
low='start_date',
high='end_date',
handling_strategy='reject_sampling' )
constraints = [start_constraint]
gc = GaussianCopula(constraints=constraints)
gc.fit(data)`
And the error obtained is pasted below
ConstraintsNotMetError Traceback (most recent call last)
<ipython-input-38-bffc85f02fc5> in <module>
11
12 gc = GaussianCopula(constraints=constraints)
---> 13 gc.fit(data)
~\Anaconda3\lib\site-packages\sdv\tabular\base.py in fit(self, data)
136
137 LOGGER.debug('Transforming table %s; shape: %s', self._metadata.name, data.shape)
--> 138 transformed = self._metadata.transform(data)
139
140 if self._metadata.get_dtypes(ids=False):
~\Anaconda3\lib\site-packages\sdv\metadata\table.py in transform(self, data, on_missing_column)
620 data = self._anonymize(data[fields])
621
--> 622 self._validate_data_on_constraints(data)
623
624 LOGGER.debug('Transforming constraints for table %s', self.name)
~\Anaconda3\lib\site-packages\sdv\metadata\table.py in _validate_data_on_constraints(self, data)
592 if set(constraint.constraint_columns).issubset(data.columns.values):
593 if not constraint.is_valid(data).all():
--> 594 raise ConstraintsNotMetError('Data is not valid for the given constraints')
595
596 def transform(self, data, on_missing_column='error'):
ConstraintsNotMetError: Data is not valid for the given constraints```
The text was updated successfully, but these errors were encountered:
Environment Details
Please indicate the following details about the environment in which you found the bug:
Error Description
ConstraintsNotMetError is raised when trying to use GreaterThan constraint with datetime.
Steps to reproduce
I have included a working example using sdv demo dataset
And the error obtained is pasted below
The text was updated successfully, but these errors were encountered: