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

Improve usage of detect_from_dataframes function #2214

Closed
npatki opened this issue Sep 9, 2024 · 0 comments · Fixed by #2221 or #2186
Closed

Improve usage of detect_from_dataframes function #2214

npatki opened this issue Sep 9, 2024 · 0 comments · Fixed by #2221 or #2186
Assignees
Labels
feature request Request for a new feature
Milestone

Comments

@npatki
Copy link
Contributor

npatki commented Sep 9, 2024

Problem Description

The metadata's detect_from_dataframes is currently meant to be used on a pre-existing instance of a metadata object. The function internally updates the metadata object and doesn't return anything.

The usage leads to some redundant code and confusion because you have to instantiate the object separately (why?), and it's unexpected that detection would not return anything. Additionally, we only expect this function to be used once, so it's not clear why it's possible to apply it to the same object multiple times.

Expected behavior

To improve the usage of this function, we will make it a class function that ultimately returns an instance of the metadata object.

from sdv.metadata import Metadata

metadata = Metadata.detect_from_dataframes(data=my_dataframes)

Additional context

All detection functions will be updated to follow this paradigm. See:

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
2 participants