red-arrow 14.0.2 → 15.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 239b9c2381130181ab30bce2c73285b8f534d89adadf743bc804b9c71e40e08d
4
- data.tar.gz: 910fad906ba73b560f2ec8aa114f682c3c1a52089cd9f95532644dc2bee8269a
3
+ metadata.gz: 61b131109a11ffd4a13d8bcd50c16c150b04c077f11bd3a58b18b5f1b705a941
4
+ data.tar.gz: 57bbcac244a80c394ea8ab37c6f606092dd8da500bd1b3e4b7391a691e80be20
5
5
  SHA512:
6
- metadata.gz: af2f5e1d5d5a9765bd7c14a453f5d132d9ee1cf6d0830417ddeefee27dcb39a5bc12c5af011a4044c85d0cee46232593eba33a2038be1fd42bcd666f3fbe098c
7
- data.tar.gz: e22c1a7920fc1ad4bfab97edaf5767cc98544ffff1deb8c730ea8097f83d1d521df31256196b2d0ddafb91077d93843357442e852ed370af3478de3ece0b3637
6
+ metadata.gz: b9ec1a416f7aa77b7d808085239cd06a89e6b69e8c3d9208ee85930e4019be5a42649022d36d71db33e28950d602942dfe4309eee7b1258bdd5b95c403080bf4
7
+ data.tar.gz: bb520a225a65162e0123217df8c82c9292e7f65bfec66a1e5ebf190aec54dc95be5d8e2f1d2ef3aa24aa330be2eafdd438ddd952624824c89bb59f9cd3b17a54
data/ext/arrow/extconf.rb CHANGED
@@ -84,7 +84,7 @@ when /darwin/
84
84
  symbols_in_external_bundles.each do |symbol|
85
85
  $DLDFLAGS << " -Wl,-U,#{symbol}"
86
86
  end
87
- mmacosx_version_min = "-mmacosx-version-min=10.14"
87
+ mmacosx_version_min = "-mmacosx-version-min=10.15"
88
88
  $CFLAGS << " #{mmacosx_version_min}"
89
89
  $CXXFLAGS << " #{mmacosx_version_min}"
90
90
  end
data/lib/arrow/array.rb CHANGED
@@ -250,7 +250,7 @@ module Arrow
250
250
  "[array][resolve] need to implement " +
251
251
  "a feature that building #{value_data_type} array " +
252
252
  "from raw Ruby Array"
253
- raise NotImpelemented, message
253
+ raise NotImplemented, message
254
254
  end
255
255
  other_array
256
256
  elsif other_array.respond_to?(:value_data_type)
@@ -24,6 +24,14 @@ module Arrow
24
24
  include GenericTakeable
25
25
  include InputReferable
26
26
 
27
+ def freeze
28
+ unless frozen?
29
+ # Ensure caching
30
+ chunks
31
+ end
32
+ super
33
+ end
34
+
27
35
  def to_arrow
28
36
  self
29
37
  end
@@ -79,9 +79,9 @@ module Arrow
79
79
  # target and corresponding order is used. `"+"` uses ascending
80
80
  # order and `"-"` uses ascending order.
81
81
  #
82
- # If `target` is not a String nor `target` doesn't start with the
83
- # leading order mark, sort column target is `target` as-is and
84
- # ascending order is used.
82
+ # If `target` is either not a String or `target` doesn't start
83
+ # with the leading order mark, sort column is `target` as-is
84
+ # and ascending order is used.
85
85
  #
86
86
  # @example String without the leading order mark
87
87
  # key = Arrow::SortKey.new("count")
@@ -252,7 +252,13 @@ module Arrow
252
252
 
253
253
  def load_as_json
254
254
  open_input_stream do |input|
255
- reader = JSONReader.new(input)
255
+ options = JSONReadOptions.new
256
+ @options.each do |key, value|
257
+ next if value.nil?
258
+ setter = :"#{key}="
259
+ options.__send__(setter, value) if options.respond_to?(setter)
260
+ end
261
+ reader = JSONReader.new(input, options)
256
262
  table = reader.read
257
263
  table.refer_input(input)
258
264
  table
data/lib/arrow/version.rb CHANGED
@@ -16,7 +16,7 @@
16
16
  # under the License.
17
17
 
18
18
  module Arrow
19
- VERSION = "14.0.2"
19
+ VERSION = "15.0.0"
20
20
 
21
21
  module Version
22
22
  numbers, TAG = VERSION.split("-")
@@ -17,6 +17,11 @@
17
17
 
18
18
  module Helper
19
19
  module Omittable
20
+ def require_ruby(major, minor, micro=0)
21
+ return if (RUBY_VERSION <=> "#{major}.#{minor}.#{micro}") >= 0
22
+ omit("Require Ruby #{major}.#{minor}.#{micro} or later: #{RUBY_VERSION}")
23
+ end
24
+
20
25
  def require_gi_bindings(major, minor, micro)
21
26
  return if GLib.check_binding_version?(major, minor, micro)
22
27
  message =
data/test/helper.rb CHANGED
@@ -18,6 +18,7 @@
18
18
  require "arrow"
19
19
 
20
20
  require "fiddle"
21
+ require "json"
21
22
  require "pathname"
22
23
  require "tempfile"
23
24
  require "timeout"
@@ -0,0 +1,34 @@
1
+ # Licensed to the Apache Software Foundation (ASF) under one
2
+ # or more contributor license agreements. See the NOTICE file
3
+ # distributed with this work for additional information
4
+ # regarding copyright ownership. The ASF licenses this file
5
+ # to you under the Apache License, Version 2.0 (the
6
+ # "License"); you may not use this file except in compliance
7
+ # with the License. You may obtain a copy of the License at
8
+ #
9
+ # http://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing,
12
+ # software distributed under the License is distributed on an
13
+ # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14
+ # KIND, either express or implied. See the License for the
15
+ # specific language governing permissions and limitations
16
+ # under the License.
17
+
18
+ class RactorTest < Test::Unit::TestCase
19
+ include Helper::Omittable
20
+
21
+ ractor
22
+ test("ChunkedArray") do
23
+ require_ruby(3, 1, 0)
24
+ array = Arrow::Array.new([1, 2, 3])
25
+ chunked_array = Arrow::ChunkedArray.new([array])
26
+ Ractor.make_shareable(chunked_array)
27
+ ractor = Ractor.new do
28
+ recived_chunked_array = Ractor.receive
29
+ recived_chunked_array.chunks
30
+ end
31
+ ractor.send(chunked_array)
32
+ assert_equal([array], ractor.take)
33
+ end
34
+ end
data/test/test-table.rb CHANGED
@@ -677,6 +677,31 @@ class TableTest < Test::Unit::TestCase
677
677
  format: :tsv,
678
678
  schema: @table.schema))
679
679
  end
680
+
681
+ def test_json
682
+ output = create_output(".json")
683
+ # TODO: Implement this.
684
+ # @table.save(output, format: :json)
685
+ columns = ""
686
+ @table.each_record.each do |record|
687
+ column = {
688
+ "count" => record.count,
689
+ "visible" => record.visible,
690
+ }
691
+ columns << column.to_json
692
+ columns << "\n"
693
+ end
694
+ if output.is_a?(String)
695
+ File.write(output, columns)
696
+ else
697
+ output.resize(columns.bytesize)
698
+ output.set_data(0, columns)
699
+ end
700
+ assert_equal(@table,
701
+ Arrow::Table.load(output,
702
+ format: :json,
703
+ schema: @table.schema))
704
+ end
680
705
  end
681
706
 
682
707
  sub_test_case("path") do
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: 14.0.2
4
+ version: 15.0.0
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: 2023-12-21 00:00:00.000000000 Z
11
+ date: 2024-01-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bigdecimal
@@ -307,6 +307,7 @@ files:
307
307
  - test/test-memory-view.rb
308
308
  - test/test-null-array.rb
309
309
  - test/test-orc.rb
310
+ - test/test-ractor.rb
310
311
  - test/test-record-batch-builder.rb
311
312
  - test/test-record-batch-file-reader.rb
312
313
  - test/test-record-batch-iterator.rb
@@ -346,7 +347,7 @@ homepage: https://arrow.apache.org/
346
347
  licenses:
347
348
  - Apache-2.0
348
349
  metadata:
349
- msys2_mingw_dependencies: arrow>=14.0.2
350
+ msys2_mingw_dependencies: arrow>=15.0.0
350
351
  post_install_message:
351
352
  rdoc_options: []
352
353
  require_paths:
@@ -442,6 +443,7 @@ test_files:
442
443
  - test/test-memory-view.rb
443
444
  - test/test-null-array.rb
444
445
  - test/test-orc.rb
446
+ - test/test-ractor.rb
445
447
  - test/test-record-batch-builder.rb
446
448
  - test/test-record-batch-file-reader.rb
447
449
  - test/test-record-batch-iterator.rb