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

Create unified Metadata class #2104

Closed
amontanez24 opened this issue Jul 2, 2024 · 0 comments · Fixed by #2186
Closed

Create unified Metadata class #2104

amontanez24 opened this issue Jul 2, 2024 · 0 comments · Fixed by #2186
Assignees
Labels
feature request Request for a new feature
Milestone

Comments

@amontanez24
Copy link
Contributor

amontanez24 commented Jul 2, 2024

Problem Description

As a user, it can be confusing to figure out which metadata to provide for different scenarios and how to format it. Since majority of the metadata is the same for all cases, it would be nice to only have one object and format to learn.

In an effort to streamline SDV workflows, we want to unify the metadata. This means we will just have one Metadata class that all synthesizers will take, whether single table, multi table or sequential.

Expected behavior

  • Do this on new feature/metadata branch
  • Create a new class called Metadata
    • This class should be pretty much the same as the MultiTableMetadata class with a couple adjustments
      1. The METADATA_SPEC_VERSION should now be V1 instead of MULTI_TABLE_V1
      2. The load_from_json method should be able to load both single and multi table jsons into this new class.
      3. The validate function should not crash if there are no relationships
      4. The validate_data function should not crash if there are no relationships
from sdv.metadata import Metadata

single_table_metadata = Metadata.load_from_json('single_table_metadata.json')
multi_table_metadata = Metadata.load_from_json('multi_table_metadata.json')

Additional context

  • We should try to be DRY and reuse code. One option is to have the new synthesizer inherit from MultiTableMetadata and just override the appropriate fields and methods.
    • We need to support backwards compatibility with the old metadata classes, meaning if someone has a pickled synthesizer with the old metadata, it shouldn't crash. An alternate approach might be to move the code to the new class and have MultiTableMetadata inherit from it. If we do this, make sure that pickled MultiTableMetadata objects still load and work properly.
  • There will be follow up issues to make the synthesizers work with this new object.
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

Successfully merging a pull request may close this issue.

2 participants