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 update_column and add_column methods to SingleTableMetadata #877

Closed
amontanez24 opened this issue Jul 7, 2022 · 0 comments
Closed
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 be able to modify or add to the metadata programmatically.

Expected behavior

  • Add update_column method
    • Not all fields are required. Just update the ones provided in the SingleTableMetadata's dict
    • Parameters:
      • column_name: string that is the name of the column to update
      • **kwargs: any key word arguments that describe metadata for a column
    • Errors:
      • If the column doesn't already exist in the metadata raise the following error
        Error: Column name ('ssnn') does not exist in the table. Use 'add_column' to add new columns.
      • Run all of the column validations that are done in the validate method. eg. Add validate method to SingleTableMetadata #879
        Error: Invalid values ("pii") for numerical column "age".
>>> metadata.update_column(column_name='ssn', pii=True)
>>> metadata.update_column(
         column_name='education',
         order=['hs', 'bachelor', 'masters', 'PhD'])
  • Add add_column method
    • All required parameters for the column metadata must be provided
    • Parameters:
      • column_name: string that is the name of the column to update
      • **kwargs: any key word arguments that describe metadata for a column
    • Errors:
      • If the column already is in the metadata, raise the following error:
        Error: Column name 'user_id' already exists. Use 'update_column' to update an existing column.
      • Run all of the column validations that are done in the validate method. eg.
        Error: Invalid values ("pii") for numerical column "age".
        Error: Invalid values ("pii") for numerical column "age".
>>> metadata.add_column(column_name='cell', sdtype='phone_number', pii=True)
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