Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better input validation when creating single and multi table synthesizers #1242

Closed
npatki opened this issue Feb 7, 2023 · 0 comments
Closed
Assignees
Labels
feature request Request for a new feature
Milestone

Comments

@npatki
Copy link
Contributor

npatki commented Feb 7, 2023

Version SDV 1.0

Problem Description

All synthesizers have enforce_min_max_values and enforce_rounding parameters that must be a boolean (True or False)

Currently, we are accepting other values that are not boolean. It is not clear what these parameters mean.

Expected behavior

If I input anything other than a boolean for these parameters, raise an error.

>>> synthesizer = GaussianCopulaSynthesizer(metadata, enforce_min_max_values='test')

SynthesizerInputError: Invalid value for parameter 'enforce_min_max_values' ('test'). Please provide True or False.

For multi table synthesizers, the same error can be thrown in the set_table_parameters method:

>>> synthesizer.set_table_parameters(
    table_name='parent_table',
    table_parameters={
        'enforce_min_max_values': 'Test',
        'enforce_rounding':'Test2',
        'default_distribution': 'beta',
        'numerical_distributions': { 'test3': 'beta' }
    }
)

SynthesizerInputError: Invalid value for parameter 'enforce_min_max_values' ('Test'). Please provide True or False.

Additional context

Just throw a single error as soon as we find one. If multiple parameters have an error, the user will just see an error for the first one we notice.

@npatki npatki added the feature request Request for a new feature label Feb 7, 2023
@npatki npatki added this to the 1.0.0 milestone Feb 7, 2023
@npatki npatki changed the title Better input validation when instantiating a single table synthesizer Better input validation when creating single and multi table synthesizers Feb 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request Request for a new feature
Projects
None yet
Development

No branches or pull requests

3 participants