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.13k stars 123 forks source link

fix DF.print for :struct #840

Closed lkarthee closed 10 months ago

lkarthee commented 10 months ago
iex> df = DF.new([%{n: %{a: 1}, m: 2}, %{n: %{a: 2}, m: 3}]) |> DF.print()
** (Protocol.UndefinedError) protocol String.Chars not implemented for %{"a" => 2} of type Map. This protocol is implemented for the following type(s): Atom, BitString, Complex, Date, DateTime, Explorer.Duration, Float, Integer, List, NaiveDateTime, Time, URI, Version, Version.Requirement
    (elixir 1.16.0) lib/string/chars.ex:3: String.Chars.impl_for!/1
    (elixir 1.16.0) lib/string/chars.ex:22: String.Chars.to_string/1
    (table_rex 4.0.0) lib/table_rex/cell.ex:85: TableRex.Cell.to_cell/2
    (elixir 1.16.0) lib/enum.ex:1700: Enum."-map/2-lists^map/1-1-"/2
    (elixir 1.16.0) lib/enum.ex:1700: Enum."-map/2-lists^map/1-1-"/2
    (elixir 1.16.0) lib/enum.ex:1700: Enum."-map/2-lists^map/1-1-"/2
    (table_rex 4.0.0) lib/table_rex/table.ex:151: TableRex.Table.add_rows/2
josevalim commented 10 months ago

:green_heart: :blue_heart: :purple_heart: :yellow_heart: :heart: