SciRuby / daru

Data Analysis in RUby
BSD 2-Clause "Simplified" License
1.03k stars 139 forks source link

Fix insert enumerable #379

Closed baarkerlounger closed 7 years ago

baarkerlounger commented 7 years ago

What if value assigned is Enumerable, but is not Array or Range? (Say, it is ActiveRecord::Relation.) What user expects is it would be converted to_a, and then inserted as a vector. What actually will happen, is pretty obscure error:

when Array, Range would be skipped; in prepare_value_for_insert, there would be called Array(relation), which will do to_a (producing array of objects)... and then multiplied by DF size, producing vector much larger than expected.