From 60c92f52b731c8fa2520b76433690e22bfe271cd Mon Sep 17 00:00:00 2001 From: Konstantin Ilchenko Date: Fri, 20 Oct 2023 23:24:26 +0200 Subject: [PATCH] Fix ArgumentError typo (#35) --- lib/polars/data_frame.rb | 4 ++-- test/data_frame_test.rb | 9 +++++++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/lib/polars/data_frame.rb b/lib/polars/data_frame.rb index 0ca6b45e35..b4e3951acd 100644 --- a/lib/polars/data_frame.rb +++ b/lib/polars/data_frame.rb @@ -5096,10 +5096,10 @@ def _comp(other, op) def _compare_to_other_df(other, op) if columns != other.columns - raise ArgmentError, "DataFrame columns do not match" + raise ArgumentError, "DataFrame columns do not match" end if shape != other.shape - raise ArgmentError, "DataFrame dimensions do not match" + raise ArgumentError, "DataFrame dimensions do not match" end suffix = "__POLARS_CMP_OTHER" diff --git a/test/data_frame_test.rb b/test/data_frame_test.rb index b418f9561f..2a15c46680 100644 --- a/test/data_frame_test.rb +++ b/test/data_frame_test.rb @@ -157,6 +157,15 @@ def test_comp_data_frame assert_frame ({"a" => [false, true, true, true]}), a <= b end + def test_comp_data_frame_different_schema + a = Polars::DataFrame.new({"a" => [1]}) + b = Polars::DataFrame.new({"b" => [1]}) + error = assert_raises(ArgumentError) do + a == b + end + assert_match "DataFrame columns do not match", error.message + end + def test_comp_scalar a = Polars::DataFrame.new({"a" => [1, 2, 3]}) assert_frame ({"a" => [false, true, false]}), a == 2