Skip to content

Commit

Permalink
Remove redundant assert
Browse files Browse the repository at this point in the history
  • Loading branch information
cdan-youdo committed Jan 19, 2025
1 parent e7e8fa5 commit 56a0ab1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
6 changes: 5 additions & 1 deletion lib/red_amber/data_frame_variable_operation.rb
Original file line number Diff line number Diff line change
Expand Up @@ -694,7 +694,11 @@ def append_to_fields_and_arrays(appender, fields, arrays, append_to_left)
raise DataFrameArgumentError, "Data size mismatch (#{data.size} != #{size})"
end

a = Arrow::Array.new(data.is_a?(Vector) ? data.to_a : data)
if data.is_a?(Vector)
a = data.data
else
a = Arrow::Array.new(data)
end

if append_to_left
fields.unshift(Arrow::Field.new(key.to_sym, a.value_data_type))
Expand Down
1 change: 0 additions & 1 deletion test/test_data_frame_variable_operation.rb
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,6 @@ class DataFrameVariableOperationTest < Test::Unit::TestCase

sub_test_case 'Dataframe with zero n_records' do
test 'assign by block' do
assert_equal :double, @df.b.type
str = <<~STR
RedAmber::DataFrame : 0 x 4 Vectors
Vectors : 2 numeric, 1 string, 1 boolean
Expand Down

0 comments on commit 56a0ab1

Please sign in to comment.