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 get_column_names method to metadata #1805

Closed
frances-h opened this issue Feb 20, 2024 · 0 comments · Fixed by #1826
Closed

Add get_column_names method to metadata #1805

frances-h opened this issue Feb 20, 2024 · 0 comments · Fixed by #1826
Assignees
Labels
feature request Request for a new feature
Milestone

Comments

@frances-h
Copy link
Contributor

Problem Description

As a user, I'd like to be able to easily get a list of all the column names in my metadata that meet the given criteria. For example, after, automatically detecting my metadata I'd like to be able to get a list of all of the columns that have the sdtype unknown

Expected behavior

Add a method get_column_names that takes in metadata keyword arguments and returns a list of all the column names that match those arguments

Single Table API

  • get_column_names(**metadata_kwargs)
    • **metadata_kwargs - Metadata keyword arguments to use to filter columns. If no kwargs are passed, all column names should be returned. Otherwise, should only return the list of column names in the metadata that match the provided kwargs.
metadata = SingleTableMetadata.detect_from_dataframe(data)
unknown_cols = metadata.get_column_names(sdtype='unknown')

Multi Table API

  • get_column_names(table_name, **metadata_kwargs)
    • table_name (str) - the name of the target table
    • **metadata_kwargs - Metadata keyword arguments to use to filter columns. If no kwargs are passed, all column names should be returned. Otherwise, should only return the list of column names in the metadata that match the provided kwargs.
metadata = MultiTableMetadata.detect_from_dataframes(data)
unknown_cols = metadata.get_column_names('table1', sdtype='unknown')
@frances-h frances-h added the feature request Request for a new feature label Feb 20, 2024
@frances-h frances-h added this to the 1.11.0 milestone Mar 21, 2024
@frances-h frances-h self-assigned this Mar 21, 2024
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.

1 participant