red-arrow 0.15.0 → 0.15.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/arrow/csv-loader.rb +10 -3
- data/lib/arrow/version.rb +1 -1
- data/red-arrow.gemspec +1 -1
- data/test/test-csv-loader.rb +75 -0
- metadata +57 -58
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 04ae0088ccf17ff76c09ad884e9c4ce6c9a9c637c8f724964c24a379e37d652e
|
4
|
+
data.tar.gz: a3387f67b30dfd07963730ff79c694d703a08f872fdb7990509d019b460e20b9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dc03abf2065a62ffeb9061f64d9e6074dd90dee464bddc4a06773635a727abc025f6b249dad19bcdfa207308ecf24e7a5f8b7e18ec127c897f63d5916a20aa31
|
7
|
+
data.tar.gz: 7dc98d5e71d23595baffda2b167494677a2d7d2269b010bea23555a6442d848248068f1e87ae3fa79c9fb61957243f038438ae3fa429f4daae3ead429c9066a1
|
data/lib/arrow/csv-loader.rb
CHANGED
@@ -93,10 +93,17 @@ module Arrow
|
|
93
93
|
@options.each do |key, value|
|
94
94
|
case key
|
95
95
|
when :headers
|
96
|
-
|
97
|
-
|
96
|
+
case value
|
97
|
+
when ::Array
|
98
|
+
options.column_names = value
|
99
|
+
when String
|
100
|
+
return nil
|
98
101
|
else
|
99
|
-
|
102
|
+
if value
|
103
|
+
options.generate_column_names = false
|
104
|
+
else
|
105
|
+
options.generate_column_names = true
|
106
|
+
end
|
100
107
|
end
|
101
108
|
when :column_types
|
102
109
|
value.each do |name, type|
|
data/lib/arrow/version.rb
CHANGED
data/red-arrow.gemspec
CHANGED
@@ -47,7 +47,7 @@ Gem::Specification.new do |spec|
|
|
47
47
|
spec.extensions = ["ext/arrow/extconf.rb"]
|
48
48
|
|
49
49
|
spec.add_runtime_dependency("extpp", ">= 0.0.7")
|
50
|
-
spec.add_runtime_dependency("gio2", "
|
50
|
+
spec.add_runtime_dependency("gio2", ">= 3.3.6")
|
51
51
|
spec.add_runtime_dependency("native-package-installer")
|
52
52
|
spec.add_runtime_dependency("pkg-config")
|
53
53
|
|
data/test/test-csv-loader.rb
CHANGED
@@ -121,6 +121,81 @@ class CSVLoaderTest < Test::Unit::TestCase
|
|
121
121
|
Arrow::CSVLoader.load(data, options)
|
122
122
|
end
|
123
123
|
|
124
|
+
sub_test_case(":headers") do
|
125
|
+
test("true") do
|
126
|
+
values = Arrow::StringArray.new(["a", "b", "c"])
|
127
|
+
assert_equal(Arrow::Table.new(value: values),
|
128
|
+
load_csv(<<-CSV, headers: true))
|
129
|
+
value
|
130
|
+
a
|
131
|
+
b
|
132
|
+
c
|
133
|
+
CSV
|
134
|
+
end
|
135
|
+
|
136
|
+
test(":first_line") do
|
137
|
+
values = Arrow::StringArray.new(["a", "b", "c"])
|
138
|
+
assert_equal(Arrow::Table.new(value: values),
|
139
|
+
load_csv(<<-CSV, headers: :first_line))
|
140
|
+
value
|
141
|
+
a
|
142
|
+
b
|
143
|
+
c
|
144
|
+
CSV
|
145
|
+
end
|
146
|
+
|
147
|
+
test("truthy") do
|
148
|
+
values = Arrow::StringArray.new(["a", "b", "c"])
|
149
|
+
assert_equal(Arrow::Table.new(value: values),
|
150
|
+
load_csv(<<-CSV, headers: 0))
|
151
|
+
value
|
152
|
+
a
|
153
|
+
b
|
154
|
+
c
|
155
|
+
CSV
|
156
|
+
end
|
157
|
+
|
158
|
+
test("Array of column names") do
|
159
|
+
values = Arrow::StringArray.new(["a", "b", "c"])
|
160
|
+
assert_equal(Arrow::Table.new(column: values),
|
161
|
+
load_csv(<<-CSV, headers: ["column"]))
|
162
|
+
a
|
163
|
+
b
|
164
|
+
c
|
165
|
+
CSV
|
166
|
+
end
|
167
|
+
|
168
|
+
test("false") do
|
169
|
+
values = Arrow::StringArray.new(["a", "b", "c"])
|
170
|
+
assert_equal(Arrow::Table.new(f0: values),
|
171
|
+
load_csv(<<-CSV, headers: false))
|
172
|
+
a
|
173
|
+
b
|
174
|
+
c
|
175
|
+
CSV
|
176
|
+
end
|
177
|
+
|
178
|
+
test("nil") do
|
179
|
+
values = Arrow::StringArray.new(["a", "b", "c"])
|
180
|
+
assert_equal(Arrow::Table.new(f0: values),
|
181
|
+
load_csv(<<-CSV, headers: nil))
|
182
|
+
a
|
183
|
+
b
|
184
|
+
c
|
185
|
+
CSV
|
186
|
+
end
|
187
|
+
|
188
|
+
test("string") do
|
189
|
+
values = Arrow::StringArray.new(["a", "b", "c"])
|
190
|
+
assert_equal(Arrow::Table.new(column: values),
|
191
|
+
load_csv(<<-CSV, headers: "column"))
|
192
|
+
a
|
193
|
+
b
|
194
|
+
c
|
195
|
+
CSV
|
196
|
+
end
|
197
|
+
end
|
198
|
+
|
124
199
|
test(":column_types") do
|
125
200
|
assert_equal(Arrow::Table.new(:count => Arrow::UInt16Array.new([1, 2, 4])),
|
126
201
|
load_csv(<<-CSV, column_types: {count: :uint16}))
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: red-arrow
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.15.
|
4
|
+
version: 0.15.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Apache Arrow Developers
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-11-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: extpp
|
@@ -28,16 +28,16 @@ dependencies:
|
|
28
28
|
name: gio2
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- -
|
31
|
+
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 3.3.
|
33
|
+
version: 3.3.6
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- -
|
38
|
+
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 3.3.
|
40
|
+
version: 3.3.6
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: native-package-installer
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -339,76 +339,75 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
339
339
|
- !ruby/object:Gem::Version
|
340
340
|
version: '0'
|
341
341
|
requirements: []
|
342
|
-
|
343
|
-
rubygems_version: 2.7.6.2
|
342
|
+
rubygems_version: 3.0.6
|
344
343
|
signing_key:
|
345
344
|
specification_version: 4
|
346
345
|
summary: Red Arrow is the Ruby bindings of Apache Arrow
|
347
346
|
test_files:
|
348
|
-
- test/test-
|
349
|
-
- test/test-
|
350
|
-
- test/test-decimal128.rb
|
351
|
-
- test/test-struct-array.rb
|
352
|
-
- test/test-data-type.rb
|
353
|
-
- test/test-list-data-type.rb
|
347
|
+
- test/test-orc.rb
|
348
|
+
- test/test-file-output-stream.rb
|
354
349
|
- test/test-dense-union-data-type.rb
|
355
|
-
- test/
|
350
|
+
- test/test-record-batch-builder.rb
|
356
351
|
- test/test-record-batch.rb
|
352
|
+
- test/test-list-data-type.rb
|
353
|
+
- test/test-decimal128.rb
|
354
|
+
- test/test-chunked-array.rb
|
355
|
+
- test/test-array.rb
|
356
|
+
- test/test-struct-array-builder.rb
|
357
357
|
- test/test-table.rb
|
358
|
-
- test/run-test.rb
|
359
|
-
- test/test-timestamp-array.rb
|
360
|
-
- test/test-date32-array.rb
|
361
|
-
- test/test-array-builder.rb
|
362
|
-
- test/test-date64-array.rb
|
363
|
-
- test/test-record-batch-file-reader.rb
|
364
358
|
- test/test-decimal128-data-type.rb
|
365
|
-
- test/
|
366
|
-
- test/test-timestamp-data-type.rb
|
367
|
-
- test/test-column.rb
|
368
|
-
- test/test-field.rb
|
369
|
-
- test/test-decimal128-array.rb
|
370
|
-
- test/test-csv-loader.rb
|
371
|
-
- test/test-bigdecimal.rb
|
372
|
-
- test/test-list-array.rb
|
373
|
-
- test/test-time64-array.rb
|
374
|
-
- test/test-rolling-window.rb
|
375
|
-
- test/test-dictionary-data-type.rb
|
359
|
+
- test/fixture/TestOrcFile.test1.orc
|
376
360
|
- test/fixture/integer-float.csv
|
377
|
-
- test/fixture/without-header-float.csv
|
378
361
|
- test/fixture/null-with-double-quote.csv
|
362
|
+
- test/fixture/with-header.csv
|
363
|
+
- test/fixture/without-header.csv
|
364
|
+
- test/fixture/without-header-float.csv
|
379
365
|
- test/fixture/with-header-float.csv
|
380
|
-
- test/fixture/TestOrcFile.test1.orc
|
381
366
|
- test/fixture/null-without-double-quote.csv
|
382
|
-
- test/fixture/without-header.csv
|
383
|
-
- test/fixture/with-header.csv
|
384
367
|
- test/fixture/float-integer.csv
|
385
|
-
- test/test
|
386
|
-
- test/test-time32-data-type.rb
|
387
|
-
- test/test-struct-data-type.rb
|
368
|
+
- test/run-test.rb
|
388
369
|
- test/test-group.rb
|
389
|
-
- test/
|
390
|
-
- test/
|
370
|
+
- test/helper.rb
|
371
|
+
- test/test-time64-array.rb
|
372
|
+
- test/test-csv-loader.rb
|
373
|
+
- test/test-feather.rb
|
374
|
+
- test/test-time64-data-type.rb
|
375
|
+
- test/values/test-sparse-union-array.rb
|
391
376
|
- test/values/test-basic-arrays.rb
|
392
|
-
- test/values/test-list-array.rb
|
393
377
|
- test/values/test-dense-union-array.rb
|
394
|
-
- test/values/test-
|
395
|
-
- test/test-
|
396
|
-
- test/test-
|
397
|
-
- test/test-
|
398
|
-
- test/test-record-batch-builder.rb
|
399
|
-
- test/raw-records/test-struct-array.rb
|
400
|
-
- test/raw-records/test-table.rb
|
401
|
-
- test/raw-records/test-basic-arrays.rb
|
402
|
-
- test/raw-records/test-list-array.rb
|
403
|
-
- test/raw-records/test-dense-union-array.rb
|
378
|
+
- test/values/test-list-array.rb
|
379
|
+
- test/values/test-struct-array.rb
|
380
|
+
- test/test-struct-data-type.rb
|
381
|
+
- test/test-date64-array.rb
|
404
382
|
- test/raw-records/test-sparse-union-array.rb
|
405
383
|
- test/raw-records/test-multiple-columns.rb
|
406
|
-
- test/test-
|
407
|
-
- test/test-
|
408
|
-
- test/test-
|
384
|
+
- test/raw-records/test-basic-arrays.rb
|
385
|
+
- test/raw-records/test-table.rb
|
386
|
+
- test/raw-records/test-dense-union-array.rb
|
387
|
+
- test/raw-records/test-list-array.rb
|
388
|
+
- test/raw-records/test-struct-array.rb
|
389
|
+
- test/test-list-array.rb
|
390
|
+
- test/test-timestamp-data-type.rb
|
391
|
+
- test/test-timestamp-array.rb
|
392
|
+
- test/test-data-type.rb
|
393
|
+
- test/test-array-builder.rb
|
394
|
+
- test/test-time32-data-type.rb
|
395
|
+
- test/test-record-batch-file-reader.rb
|
396
|
+
- test/test-rolling-window.rb
|
397
|
+
- test/test-list-array-builder.rb
|
398
|
+
- test/test-slicer.rb
|
409
399
|
- test/test-decimal128-array-builder.rb
|
410
|
-
- test/test-chunked-array.rb
|
411
400
|
- test/test-schema.rb
|
412
|
-
- test/test-
|
413
|
-
- test/
|
401
|
+
- test/test-time.rb
|
402
|
+
- test/test-column.rb
|
403
|
+
- test/test-bigdecimal.rb
|
404
|
+
- test/test-sparse-union-data-type.rb
|
405
|
+
- test/test-tensor.rb
|
414
406
|
- test/test-time32-array.rb
|
407
|
+
- test/test-buffer.rb
|
408
|
+
- test/test-decimal128-array.rb
|
409
|
+
- test/helper/fixture.rb
|
410
|
+
- test/test-dictionary-data-type.rb
|
411
|
+
- test/test-date32-array.rb
|
412
|
+
- test/test-field.rb
|
413
|
+
- test/test-struct-array.rb
|