nanoarrow 0.1.1 → 0.1.2

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: a01c23d857a3993f98281df9c297cc68e27550cdd19eff8844dc088389e73375
4
- data.tar.gz: 272666407eaab6685a2739e4e318a9f17df6f3284a2b5438cd5a6729d9ca6345
3
+ metadata.gz: 03311f979ec7b06c710266061eadecd313088d511107d3e557192e823dffd90d
4
+ data.tar.gz: 6c39c7cdb72aa529c4b51a9104811c8796aecb503d1dc2cc79c8f7d143f5e9db
5
5
  SHA512:
6
- metadata.gz: 86fcf358b4353c6b7047907a691c0742e3404c0030f7f486bd60295746c8ac6ede47630cbb4d88585166f1ac5e900ad9be688952613251efbeca26027746202c
7
- data.tar.gz: cc2e9133a58184ec28159268840d5831eec8b2fd445986da2f36b2c7743ffa567e581979771f4294481ff9af82e2c504d6358d5856ef3cf0d679b3b103f61e29
6
+ metadata.gz: ebf988503dbe70a6a11c6716b397c2dc22ff80c5d7d97f6185dbf124f2a22cc6da6d2d1e3044a62c31bd5ce47e07ba264ec196f90fd2ea6c79dc8aae285483b3
7
+ data.tar.gz: 0272d0d567a704dd99c87b7c5f6bac3696240a6a6b114e9e5697d8a55cc441fe68479a557f586c07e539e8bef215e8efee7df08bebfac93262a577f72d0ab4d3
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## 0.1.2 (2026-07-22)
2
+
3
+ - Fixed `to_a` method for struct type
4
+
1
5
  ## 0.1.1 (2026-07-21)
2
6
 
3
7
  - Added support for more types
@@ -51,14 +51,13 @@ static VALUE array_stream_import_from_c_capsule(VALUE klass, VALUE schema_capsul
51
51
 
52
52
  static VALUE array_stream_from_c_arrays(VALUE klass, VALUE arrays, VALUE schema, VALUE validate)
53
53
  {
54
- array_stream_t* stream;
55
- VALUE out = array_stream_allocate(klass);
56
- GetArrayStream(out, stream);
54
+ struct ArrowArrayStream* c_array_stream_out;
55
+ VALUE base = alloc_c_array_stream(&c_array_stream_out);
57
56
 
58
57
  // TODO move to parameter
59
58
  VALUE move = Qfalse;
60
59
 
61
- VALUE out_schema;
60
+ VALUE out_schema = schema;
62
61
  VALUE validate_schema;
63
62
  if (RTEST(validate) && !RTEST(move))
64
63
  {
@@ -73,18 +72,15 @@ static VALUE array_stream_from_c_arrays(VALUE klass, VALUE arrays, VALUE schema,
73
72
  else
74
73
  out_schema = rb_funcall(schema, rb_intern("deep_dup"), 0);
75
74
 
76
- schema_t* schema_ptr;
77
- GetSchema(out_schema, schema_ptr);
75
+ schema_t* out_schema_ptr;
76
+ GetSchema(out_schema, out_schema_ptr);
78
77
 
79
78
  Check_Type(arrays, T_ARRAY);
80
79
  long arrays_len = RARRAY_LEN(arrays);
81
80
 
82
- stream->base = alloc_c_array_stream(&stream->ptr);
83
-
84
- int code = ArrowBasicArrayStreamInit(stream->ptr, schema_ptr->ptr, arrays_len);
81
+ int code = ArrowBasicArrayStreamInit(c_array_stream_out, out_schema_ptr->ptr, arrays_len);
85
82
  raise_error_not_ok("ArrowBasicArrayStreamInit()", code);
86
83
 
87
- struct ArrowArrayStream* c_array_stream_out = stream->ptr;
88
84
  struct ArrowArray tmp;
89
85
  for (long i = 0; i < arrays_len; i++)
90
86
  {
@@ -110,6 +106,11 @@ static VALUE array_stream_from_c_arrays(VALUE klass, VALUE arrays, VALUE schema,
110
106
  raise_message_not_ok(&error, "ArrowBasicArrayStreamValidate()", code);
111
107
  }
112
108
 
109
+ array_stream_t* stream;
110
+ VALUE out = array_stream_allocate(klass);
111
+ GetArrayStream(out, stream);
112
+ stream->base = base;
113
+ stream->ptr = c_array_stream_out;
113
114
  return out;
114
115
  }
115
116
 
@@ -198,5 +198,5 @@ void c_array_shallow_copy(VALUE base, const struct ArrowArray* src, struct Arrow
198
198
 
199
199
  ArrowArrayMove(tmp, dst);
200
200
 
201
- (void) shelter;
201
+ RB_GC_GUARD(shelter);
202
202
  }
@@ -108,7 +108,7 @@ module Nanoarrow
108
108
  if @children.any?
109
109
  keys = @schema.children.map(&:name)
110
110
  @children[0].each.zip(*@children[1..]) do |v|
111
- block.call(v[0].nil? ? nil : keys.zip(v).to_h)
111
+ block.call(keys.zip(v).to_h)
112
112
  end
113
113
  end
114
114
  end
@@ -1,3 +1,3 @@
1
1
  module Nanoarrow
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nanoarrow
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Kane