Commits

ptaylor authored e523db4585e
ARROW-5741: [JS] Make numeric vector from functions consistent with TypedArray.from This PR updates `IntVector.from()` and `FloatVector.from()` to use the new Builders to cast input values that don't exactly match the expected numeric type, per [this discussion](https://lists.apache.org/thread.html/b648a781cba7f10d5a6072ff2e7dab6c03e2d1f12e359d9261891486@%3Cdev.arrow.apache.org%3E) on the mailing list. Previously, these methods behaved like `reinterpret_cast` in C++, but now they behave like numpy's `ndarray.astype()`. The new behavior of zero-copy vs. copied is: * If the input type is the same as the Vector we want to create, the Vector is created zero-copy * If if the input type is different (or the input isn't a TypedArray), we use the Builders to enumerate the values, cast each one to the desired type, and construct a new Vector from the results. Closes [ARROW-5741](https://issues.apache.org/jira/browse/ARROW-5741) Closes #4746 from trxcllnt/js/update-int-float-from-methods and squashes the following commits: 4b606a6c2 <ptaylor> fix lint 0ac754db2 <ptaylor> update half float conversions 96d981a56 <ptaylor> Rebased from master and squashed: Authored-by: ptaylor <paul.e.taylor@me.com> Signed-off-by: ptaylor <paul.e.taylor@me.com>