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

remove csv export for list column - not supported by polars #130

Merged

Conversation

lkarthee
Copy link
Contributor

@lkarthee lkarthee commented Jan 3, 2024

CSV export not supported by Polars if column contains nested data - pola-rs/polars#6038

@lkarthee
Copy link
Contributor Author

lkarthee commented Jan 3, 2024

 [error] GenServer #PID<0.338.0> terminating
** (RuntimeError) dump_csv failed: %RuntimeError{message: "Polars Error: CSV format does not support nested data"}
    (explorer 0.8.0-dev) lib/explorer/data_frame.ex:1384: Explorer.DataFrame.dump_csv!/2
    (kino_explorer 0.1.14) lib/kino/explorer.ex:96: Kino.Explorer.export_data/2
    (kino 0.12.1) lib/kino/table.ex:132: Kino.Table.handle_event/3
    (kino 0.12.1) lib/kino/js/live/server.ex:116: Kino.JS.Live.Server.call_handle_info/3
    (kino 0.12.1) lib/kino/js/live/server.ex:71: Kino.JS.Live.Server.handle_info/2
    (stdlib 5.1.1) gen_server.erl:1077: :gen_server.try_handle_info/3
    (stdlib 5.1.1) gen_server.erl:1165: :gen_server.handle_msg/6
    (stdlib 5.1.1) proc_lib.erl:241: :proc_lib.init_p_do_apply/3
Last message: {:event, "download", %{"format" => "CSV"}, %{origin: "o6whecuftdebsgy5", ref: "xofgz5j345y5umjfo543tpyxdeq5mpp7"}}
State: %{module: Kino.Table, export: #Function<3.116305928/1 in Kino.Table.new/3>, ctx: %Kino.JS.Live.Context{assigns: %{info: %{name: "Series", export: %{formats: ["CSV", "NDJSON", "Parquet"]}, features: [:export, :pagination, :sorting]}, module: Kino.Explorer, state: %{columns: [%{label: "series", type: "list", key: "series", summary: %{keys: ["unique", "top", "top freq", "nulls"], values: ["5", <<1>>, "1", "0"]}}], total_rows: 5, df: #Explorer.DataFrame<
          Polars[5 x 1]
          series list[s64] [[1], [2], [3], [4], [...]]
        >, groups: []}, limit: 10, content: %{data: [["[1]", "[2]", "[3]", "[4]", "[5]"]], columns: [%{label: "series", type: "list", key: "0", summary: %{keys: ["unique", "top", "top freq", "nulls"], values: ["5", <<1>>, "1", "0"]}}], limit: 10, page: 1, order: nil, total_rows: 5, data_orientation: :columns, max_page: 1, page_length: 5}, page: 1, order: nil, key_to_string: %{"series" => "0"}}, origin: nil, __private__: %{ref: "xofgz5j345y5umjfo543tpyxdeq5mpp7", client_ids_with_pid: %{"gvnozrhypivscjlc" => #PID<12985.5404.0>, "o6whecuftdebsgy5" => #PID<12985.5310.0>}, monitors_with_client_id: %{#Reference<0.386934388.2180775939.109449> => "gvnozrhypivscjlc", #Reference<0.386934388.2180775939.109458> => "o6whecuftdebsgy5"}}}}

Copy link
Contributor

@cristineguadelupe cristineguadelupe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch! Thanks

@cristineguadelupe cristineguadelupe merged commit 18cb90a into livebook-dev:main Jan 3, 2024
1 check passed
@lkarthee lkarthee deleted the remove_export_csv_for_list branch January 4, 2024 01:05
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

Successfully merging this pull request may close these issues.

2 participants