-
Notifications
You must be signed in to change notification settings - Fork 126
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
Invalid Struct contents with {:list, {:struct, %{...}}
#847
Comments
I'm investigating this. It looks like a problem when we try to create the series in the backend (Rust side). For some reason, the series seems to lose its data (or dtype). For what I could see, the data is arriving correctly when we pass down to Polars. I will try to reproduce it in an isolated project. |
* Fix `from_list/2` of list of structs when fist is empty Closes #847 * Update test/explorer/series/list_test.exs
@philss Thanks for your fix! Unfortunately while testing the newest Code Mix.install([{:explorer, github: "elixir-explorer/explorer"}])
[
[],
[%{"a" => "a", "b" => "b"}]
]
|> Explorer.Series.from_list(dtype: {:list, {:struct, %{"a" => :string, "b" => :string}}})
|> dbg Running this script 100 times results in 73 panics and 27 successful runs on my machine. Ok Output
Error Output
Full
|
I think this might have to do with map order based on the error message. |
@maennchen makes sense! Not sure yet how to solve this, but I'm going to take a look. Thanks for the reports! |
@philss To acurately represent the Otherwise it is impossible to make sure that the structure is represented correctly. Doing that will allow to sort the columns correctly when reading them from elixir. |
I think that's a solid idea that will make it look more elegant too. |
@josevalim @maennchen please take a look: #851. I think it will fix the problem :) |
Versions
Explorer:
0.8.0
Elixir:
1.16.0
OTP:
26.2.1
Reproduction
Expected
The series with an empty list at the start should have
[%{"a" => 1}]
as the value for the second item and not[%{"" => nil}]
.The text was updated successfully, but these errors were encountered: