❖ ForeignToForeignKey

Constraint API
Usage
Last updated

Last updated
from sdv.cag import ForeignToForeignKey
my_constraint = ForeignToForeignKey(
columns=[{
'table_name': 'Products',
'foreign_key': 'Warehouse ID'
},{
'table_name': 'Shipments',
'foreign_key': 'Warehouse ID'
}],
foreign_key_generation='new'
)synthesizer = HSASynthesizer(metadata)
synthesizer.add_constraints([my_constraint])
synthesizer.fit(data)
synthetic_data = synthesizer.sample()