Skip to content

Commit

Permalink
chore: add red reproduction of issue
Browse files Browse the repository at this point in the history
Keyword list of pairs will raise the issue, and is the only construct
where this will happen. A map would fail to reproduce because the key is
overwritten based on the last input to the construction.
  • Loading branch information
pcapel committed Feb 7, 2024
1 parent 5dbdbbd commit 3080d79
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions test/explorer/data_frame_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -2763,6 +2763,14 @@ defmodule Explorer.DataFrameTest do
end
end

test "with keyword and a column that is duplicated" do
df = DF.new(a: [1, 2, 3], b: ["a", "b", "c"])

assert_raise ArgumentError, ~r"duplicate column name \"g\"", fn ->
DF.rename(df, a: "first", a: "second")
end
end

test "with a map and a column that doesn't exist" do
df = DF.new(a: [1, 2, 3], b: ["a", "b", "c"])

Expand Down

0 comments on commit 3080d79

Please sign in to comment.