Skip to content

Commit

Permalink
Revert "Preserver type of empty datasets"
Browse files Browse the repository at this point in the history
This reverts commit e7e8fa5.
  • Loading branch information
cdan-youdo committed Jan 19, 2025
1 parent 56a0ab1 commit 9bece65
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
7 changes: 1 addition & 6 deletions lib/red_amber/data_frame_variable_operation.rb
Original file line number Diff line number Diff line change
Expand Up @@ -675,12 +675,7 @@ def update_fields_and_arrays(updater)
raise DataFrameArgumentError, "Data size mismatch (#{data.size} != #{size})"
end

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

a = Arrow::Array.new(data.is_a?(Vector) ? data.to_a : data)
fields[i] = Arrow::Field.new(key, a.value_data_type)
arrays[i] = Arrow::ChunkedArray.new([a])
end
Expand Down
2 changes: 1 addition & 1 deletion test/test_group.rb
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ class GroupTest < Test::Unit::TestCase
Vectors : 3 numeric
# key type level data_preview
0 :i uint8 4 [0, 1, 2, nil], 1 nil
1 :count int64 3 [2, 1, 2, 0]
1 :count uint8 3 [2, 1, 2, 0]
2 :"sum(f)" double 4 [1.1, 2.2, NaN, nil], 1 NaN, 1 nil
STR
assert_equal str, @df.group(:i) { [count(:i, :f, :b), sum] }.tdr_str(tally: 0)
Expand Down

0 comments on commit 9bece65

Please sign in to comment.