red-arrow-numo-narray 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/doc/text/news.md +6 -0
- data/lib/arrow-numo-narray/error.rb +1 -1
- data/lib/arrow-numo-narray/to-narray.rb +1 -1
- data/lib/arrow-numo-narray/version.rb +2 -2
- data/test/test-to-narray.rb +8 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 84a1f4eb838f8640c7f67f3fbdd9446ae769ce7aef16f6b98a9abd5cc8f87bf4
|
4
|
+
data.tar.gz: a9fed15ebb2b9e034c40d15b45974c06995b9b9dea66c48b25d2f785932d98e5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 28415f30fcc072a07f7d5eef18a1291aa51e4eaa1e5f4a1f8d7f274505d45c624d9c4c6e1dc7749d3c54e837038a5babc57300aa496671253266987ed05f0d30
|
7
|
+
data.tar.gz: 3cc883a79b281e668b2cf05f9e74ec6989278bd87677d801e3c3c912fcb56f643cca4b7c0050b0269c847525c84818b5f7189a106d16ff9d35f90d60b554ccfa
|
data/doc/text/news.md
CHANGED
@@ -77,7 +77,7 @@ module Arrow
|
|
77
77
|
def to_narray
|
78
78
|
unless n_nulls.zero?
|
79
79
|
message = "can't convert #{self.class} that has null values to NArray"
|
80
|
-
raise
|
80
|
+
raise ArrowNumoNArray::UnconvertibleError, message
|
81
81
|
end
|
82
82
|
narray = value_data_type.narray_class.new(length)
|
83
83
|
narray.store_binary(buffer.data.to_s)
|
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright 2017 Kouhei
|
1
|
+
# Copyright 2017-2019 Sutou Kouhei <kou@clear-code.com>
|
2
2
|
#
|
3
3
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
4
|
# you may not use this file except in compliance with the License.
|
@@ -13,5 +13,5 @@
|
|
13
13
|
# limitations under the License.
|
14
14
|
|
15
15
|
module ArrowNumoNArray
|
16
|
-
VERSION = "0.0.
|
16
|
+
VERSION = "0.0.3"
|
17
17
|
end
|
data/test/test-to-narray.rb
CHANGED
@@ -14,6 +14,14 @@
|
|
14
14
|
|
15
15
|
class ToNAarrayTest < Test::Unit::TestCase
|
16
16
|
sub_test_case("Array") do
|
17
|
+
test("with NULL") do
|
18
|
+
array = Arrow::Int8Array.new([0, nil])
|
19
|
+
message = "can't convert #{array.class} that has null values to NArray"
|
20
|
+
assert_raise(ArrowNumoNArray::UnconvertibleError.new(message)) do
|
21
|
+
array.to_narray
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
17
25
|
test("Int8") do
|
18
26
|
array = Arrow::Int8Array.new([-(2 ** 7), 0, 2 ** 7 - 1])
|
19
27
|
assert_equal(Numo::Int8[-(2 ** 7), 0, 2 ** 7 - 1],
|