-
Notifications
You must be signed in to change notification settings - Fork 120
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
NIF Panic with duplicated key in rename #848
Comments
I see that the linked function is for the |
I agree we should validate before we pass off to Polars. Old contentsAlso, I think there's a bug in the validation code? https://github.com/elixir-explorer/explorer/blob/main/lib/explorer/shared.ex#L225-L234 This unless Map.has_key?(df.dtypes, name) do
# ^^^^^^^^^
should be unless Map.has_key?(df.names, name) do
# ^^^^^^^^
right? EDIT: No I was wrong about there maybe being a bug. |
Overview
It's a nit pick, but a NIF panic is a surprising error when a key is duplicated in the
DataFrame.rename
function. A more descriptive error would make a lot of sense.It looks like there already some validation where this could fit in, happy to add support if this is deemed worthwhile.
Minimal reproduction via the livebook below.
Reproduce Panic
Section
The text was updated successfully, but these errors were encountered: