Closed nathanrboyer closed 1 year ago
@nathanrboyer - this is an issue for DataAPI.jl, so I am moving it.
@nalimilan - what do you think?
To start with I wanted setting style
to be explicit, but maybe indeed allowing for :default
by default is better.
@nathanrboyer - I am working on TableMetadataTools.jl so expect changes in the code.
I can write this at the top of my script to get the desired behavior, but there is probably a cleaner way with metaprogramming:
DataFrames.metadata!(df::DataFrame, key::AbstractString, value::Any) = DataFrames.metadata!(df, key, value; style=:default)
If it was named something other than :default
, then I could see forcing the user to be explicit in the main package and only providing the convenience method in the helper package.
I understand your rationale. Let us wait for @nalimilan to comment. The change will be easy to implement.
Sounds good.
Maybe this was discussed already, but I would think a
style
named:default
would be defaulted to ifstyle
is not provided. I would like to seestyle
as an optional keyword argument so thatmetadata!(df, "key", "value")
is allowed. (Then TableMetadataTools.jl would define a way to change what stylemetadata!(df, "key", "value")
uses.)