-
Notifications
You must be signed in to change notification settings - Fork 317
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
Update tests to use Metadata #2178
Conversation
sdv/single_table/base.py
Outdated
if isinstance(metadata, Metadata): | ||
self.table_name = metadata._get_single_table_name() |
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'm confused about this scenario. If multiple tables are in the metadata, then we error in the single table case so we don't need the warning. Maybe we should also just error if the user doesn't pass a table name in instead of replacing with a default
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 scenario is if there is a single table, we want to make sure get_metadata
returns the single table object with the correct name attached to the table (same one that is passed in) if there isn't a name (e.g. legacy SingleTableMetadata
passed in) we can use the default name.
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.
If it's a legacy metadata then it won't enter this branch of the if right? And if it's the legacy metadata why do we need a name?
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.
You're right, legacy metadata will just have the default name so it's not the best example.
When we call get_metadata
that comes out with the class Metadata
. That table should match whatever was put into the class so the user can refer to the table using the same table name.
resolves #2151
CU-86b1efup0
Moves tests to use Metadata.
This does two things: