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

Add detect methods to SingleTableMetadata #876

Closed
amontanez24 opened this issue Jul 7, 2022 · 0 comments · Fixed by #909
Closed

Add detect methods to SingleTableMetadata #876

amontanez24 opened this issue Jul 7, 2022 · 0 comments · Fixed by #909
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 very useful if some template of the metadata could automatically be detected/constructed from my data.

Expected behavior

  • The detect methods only need to detect the sdtypes for each column.
  • Add detect_from_csv(filepath) method
    • Parameters
      • filepath: string that is the full path to the csv file
    • Errors
      • If the metadata has already been detected, raise the following error
      Error: Metadata already exists. Create a new SingleTableMetadata object to detect from other data sources.
    • Should print the detected metadata as follows
>>> metadata = SingleTableMetadata()
>>> metadata.detect_from_csv(filepath='folder/data.csv')

Detected metadata:
{
    "columns": {
        "student_id": { "sdtype": "numerical" },
        "gender": { "sdtype": "categorical" },
        "gpa": { "sdtype": "numerical" },
        "age": { "sdtype": "numerical" },
        "education_level": { "sdtype": "categorical" }
    }
}
  • Add detect_from_dataframe(data) method
    • Parameters
      • data: the dataframe
    • Errors
      • If the metadata has already been detected, raise the following error
      Error: Metadata already exists. Create a new SingleTableMetadata object to detect from other data sources.
    • Should also print the detected metadata
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