elixir-explorer / explorer

Series (one-dimensional) and dataframes (two-dimensional) for fast and elegant data exploration in Elixir
https://hexdocs.pm/explorer
MIT License
1.08k stars 116 forks source link

Replace infer_schema_length by infer_schema #972

Open josevalim opened 3 weeks ago

josevalim commented 3 weeks ago

Today infer_schema_length has an awkward API, since setting it to nil is used to infer all columns and 0 is used to disable it.

I propose:

infer_schema: true | false | non_neg_integer()

Where true enables, false disables, and the integer configures the length. The default can be the same as today.

cigrainger commented 3 weeks ago

I like this, but what would we use for all rows? IIUC true -> default (1000 rows).

josevalim commented 3 weeks ago

true means all rows.

lei0zhou commented 3 weeks ago

thanks for improving this! just share a way duckdb did. it has two parameters,

ref: CSV Import – DuckDB CSV Auto Detection – DuckDB

I am more than happy to take a stab at this