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 SingleTableMetadata class #873

Closed
amontanez24 opened this issue Jul 7, 2022 · 0 comments
Closed

Create SingleTableMetadata class #873

amontanez24 opened this issue Jul 7, 2022 · 0 comments
Assignees
Labels
feature request Request for a new feature
Milestone

Comments

@amontanez24
Copy link
Contributor

amontanez24 commented Jul 7, 2022

Problem Description

As a user, it would be helpful to have a class that I could interact with programmatically to handle all things related to single table metadata.

Expected behavior

  • In the metadata module, we should add a class called SingleTableMetadata
  • The class should have some private dict attribute that will store and keep track of the actual metadata for the class
  • The __init__ requires no parameters
  • There should be a to_dict method that returns the underlying json as a python dictionary
python_dict = metadata.to_dict()
  • There should be an internal _load_from_dict class method that returns a SingleTableMetadata instance with the dictionary set to the dict provided
metadata = SingleTableMetadata._load_from_dict(dict)
  • The __repr__ method should be overwritten so that when printed, the metadata class shows the underlying dictionary
>>> print(metadata)
{
    "columns": {
        "student_id": { "sdtype": "numerical" },
        "gender": { "sdtype": "categorical" },
        "gpa": { "sdtype": "numerical" },
        "age": { "sdtype": "numerical" },
        "education_level": { "sdtype": "categorical" }
      }
}
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

No branches or pull requests

2 participants