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

Use reject sampling to sample missing columns for constraints #475

Merged
merged 4 commits into from
Jun 25, 2021

Conversation

amontanez24
Copy link
Contributor

@amontanez24 amontanez24 commented Jun 23, 2021

resolves #435

@csala csala requested a review from fealho June 25, 2021 15:03
Copy link
Contributor

@csala csala left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this looks good already!
I added a couple of comments about a lint issue and a test docstring that could be refined, but I think it is almost ready to go.

@@ -1,5 +1,7 @@
from sdv.constraints.tabular import GreaterThan
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be further down, with the other sdv imports

model should be valid because reject sampling is used on any that aren't.

Setup:
- The model is being passed a ``GreaterThan`` constraint and then
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This description of the test is great! However, the Setup section should be more about "What needs to be set up for this test to happen". So, in this case, rather than explaining what is expected to happen, I would mention that the setup involves a mock of the GM that will sample rows that do not satisfy the constraint to force the reject sampling to be used.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The reason for this is that the model being mocked is not the one in the constraint but the one in sdv. I didn't mock the constraint's _columns_model since it is an integration test. I only mocked the other model so that we don't have to wait for it to fit

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update: I mocked the column model to force reject sampling

Copy link
Contributor

@csala csala left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good to go

@amontanez24 amontanez24 merged commit b418836 into master Jun 25, 2021
@amontanez24 amontanez24 deleted the sdv-issue-435 branch June 25, 2021 22:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use reject sampling to sample missing columns for constraints
2 participants