Livebook DataTable displaying charlist as list

I’m seeing that a list inside a Kino.DataTable will be interpreted as a charlist, even if the Kino.configure() is set to charlists: :as_lists. It appears that it’s using

Example:

Setup

Mix.install([
{:kino, "~> 0.19.0"}
])

Elixir code block

Kino.configure(inspect: [charlists: :as_lists])
fr = Kino.Frame.new |> Kino.render()
Kino.Frame.append(fr, Kino.DataTable.new([%{:a => [1,8],:b => [9,8]}]))
Kino.Frame.append(fr, Kino.Inspect.new([9,8]))

The DataTable displays b: as blank, since [9,8] would be ~c"\t\b". :a displays as I expected,with [1,8].

The Kino.Inspect line displays is as [9,8] as expected.

I suspect there’s another layer if IO.Inspect in there somewhere, but I’m not sure how to configure it.

Any thoughts or advice? Thanks. This is on Livebook v0.19.9 and Elixir v1.19.3.

I think Kino.DataTable does not apply the config from Kino.configure(inspect: ...) config. Maybe it should? cc @jonatanklosko

But it has a formatter option, like:

Kino.DataTable.new(
  [%{a: [1, 8], b: [9, 8]}],
  formatter: fn
    _key, value when is_list(value) -> {:ok, inspect(value, charlists: :as_lists)}
    _key, _value -> :default
  end
)

Ah, nice. I didn’t think about using the formatter this way. Appreciate the tip!

I just changed the DataTable to respect the inspect options, see Respect charlists as list in datatable columns by jonatanklosko · Pull Request #514 · livebook-dev/kino · GitHub