Skip to content

Allow me to use non-key ID columns in a FixedCombinations-type constraint (constant values) #2483

@npatki

Description

@npatki

Background

In my data, I have an ID column called product-id and a categorical column called source. For each product-id, the source always has to be constant, as shown below.

Image

I want my synthetic data to exhibit this same property: For a given product-id value, the source value should always be the same

Problem Description

I am unable to meet this requirement.

  • One possible solution could be to apply a FixedCombinations constraint to these two columns. But the SDV gives me an error saying that the constraint is only valid for categorical and boolean columns (even though in this case product-id is being treated as categorical)
InvalidConstraintsError: The provided constraint is invalid:
Invalid columns ("product-id") supplied to a FixedCombinations constraint. This constraint only supports boolean and categorical columns.
  • However, another solution could be to have a new constraint that enforces constant values of source for a given product-id

Additional context

A simple workaround for now is to update the sdtype of this column to be categorical.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions