From 3080d79192720c8fe5bb2a5b7e08acb07bed6432 Mon Sep 17 00:00:00 2001 From: Philip Capel Date: Wed, 7 Feb 2024 12:32:12 -0600 Subject: [PATCH] chore: add red reproduction of issue 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. --- test/explorer/data_frame_test.exs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/test/explorer/data_frame_test.exs b/test/explorer/data_frame_test.exs index 18fa48fb5..5f9e7ffb4 100644 --- a/test/explorer/data_frame_test.exs +++ b/test/explorer/data_frame_test.exs @@ -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"])