-
Notifications
You must be signed in to change notification settings - Fork 301
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
Conversation
There was a problem hiding this 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 |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good to go
0f5508a
to
6a0c41e
Compare
resolves #435