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

Tables column names overriden #121

Open
jeremiedb opened this issue Nov 17, 2023 · 1 comment
Open

Tables column names overriden #121

jeremiedb opened this issue Nov 17, 2023 · 1 comment

Comments

@jeremiedb
Copy link
Contributor

Not a bug per se as it seems a deisgn choice, but the introduction of the override of column names in DataTableOptions in v0.22.9:

[Column(string(name), sortable = true, label = label_clean(name)) for name in TablesInterface.columnnames(t.data)]

happened to be undesirable for our applications. I would personally favor in general limited stylistic side effects from functions by default. Could adding a kw arg in DataTableOptions for specifying custom column names as Vector{String} cover those custom names needs, or having an opt-in "clean_colnames" boolean indicator?

@hhaensel
Copy link
Member

hhaensel commented Nov 17, 2023

I agree that uppercasing is a bit surprising, maybe we re-think/revise this or offer a kwarg to replace label_clean by a customer function, e.g. x -> string(x) or identify.

Meanwhile there's an easy solution to this that you can implement yourself, assuming that you are using DataFrames

mycolumns(df) = [Column(string(name), sortable = true, label = string(name)) for name in names(df)]
puredatatable(df) = DataTable(df, DataTableOptions(columns = mycolumns(df)))

dt = puredatatable(df) 

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

No branches or pull requests

2 participants