-
Notifications
You must be signed in to change notification settings - Fork 305
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
Add validate_data
for multi-table
#1541
Conversation
sdv/metadata/multi_table.py
Outdated
return [error_msg] if error_msg else [] | ||
|
||
def validate_with_data(self, data): | ||
"""Validate the data matches the metadata.""" |
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.
Note: improve docstring
Codecov ReportPatch coverage:
❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more. Additional details and impacted files@@ Coverage Diff @@
## master #1541 +/- ##
==========================================
- Coverage 96.44% 96.07% -0.38%
==========================================
Files 48 48
Lines 4025 4052 +27
==========================================
+ Hits 3882 3893 +11
- Misses 143 159 +16
☔ View full report in Codecov by Sentry. |
15375c2
to
fad0ee1
Compare
sdv/metadata/multi_table.py
Outdated
if table_synthesizers: | ||
table_synthesizers[table_name].validate(table_data) |
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 we should keep this out of the metadata. It's a strange cyclic relationship. I think we can just do the case in the else and then do the case in the if only in the MultiTableSynthesizer
. That would also make it clear why MultiTableMetadata.validate_data
isn't being called in the synthesizer.
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 issue of doing that is the code gets duplicated, which is why I took this approach. It is confusing though, so I guess I'll just leave the duplicated code there.
fad0ee1
to
c9b4fc5
Compare
c9b4fc5
to
0df9f1b
Compare
validate_with_data
for multi-tablevalidate_data
for multi-table
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!
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.
Looks good! 👍
Resolve #1518 for multi table.