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

Feature request: for metadata! to accept a dictionary as input #3469

Open
alex-s-gardner opened this issue Sep 27, 2024 · 2 comments
Open

Feature request: for metadata! to accept a dictionary as input #3469

alex-s-gardner opened this issue Sep 27, 2024 · 2 comments
Labels
Milestone

Comments

@alex-s-gardner
Copy link

alex-s-gardner commented Sep 27, 2024

To copy metadata between data frames (df1 and df2) requires:

md = DataFrames.metadata(df1)
for k in keys(md)
    DataFrames.metadata!(df2, k, md[k])
end

It would be convenient if metadata! could directly accept metadata Dict() output so that the above becomes:

DataFrames.metadata!(df2, DataFrames.metadata(df1))

I suspect this would also be handy for setting multiple metadata fields with a single Dict()

@bkamins
Copy link
Member

bkamins commented Sep 29, 2024

Currently https://github.com/JuliaData/TableMetadataTools.jl is intended to support such operations as in DataAPI.jl we wanted to keep a minimal API that is required. Would this extra package meet your needs?

@bkamins bkamins added this to the 1.x milestone Sep 29, 2024
@alex-s-gardner
Copy link
Author

To me its seems that simplifying the copying of metadata between data frames would be best handled in native DataFrames.jl as this is an entry point for most people. I would think that the change to code would be minimal as it would just be a simple DataFrames.metadata! dispatch on a dictionary. But you'll certainly have a more informed view on this than I.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants