Skip to content

Commit

Permalink
Fix ArgumentError typo (#35)
Browse files Browse the repository at this point in the history
  • Loading branch information
simpl1g authored Oct 20, 2023
1 parent 99680e1 commit 60c92f5
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/polars/data_frame.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
9 changes: 9 additions & 0 deletions test/data_frame_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 60c92f5

Please sign in to comment.