turbine_rb 0.2.3 → 0.2.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0a11f956824241734f8451193c425926e41b445beaaafa666646f232fd29b161
4
- data.tar.gz: '03494bc92e293ea4e6d5661e91697805617a627d23cae8147b0a455b22d4b50f'
3
+ metadata.gz: f332f91c7edc265b27163b8f1f9ad8a8dd1bfa928db196da9a80fa4de16dea5f
4
+ data.tar.gz: cb996cf874226d9f643cead4f949b5e603412d260be2274db983cfed249514f5
5
5
  SHA512:
6
- metadata.gz: a10a974df6771cd2803a5fca00647f212bc2278b08ce52ad6e2181fdd32ae1ed66af6987143252f1ee27422911ec77af6d2e2f9fe52c3a852037c740e05baf9a
7
- data.tar.gz: 5dc38c122a76db77821b85436bdce71d6c775d6c2be0a8694bcae1d2ea8d7db5c8baa5a60e9cf8e1ebaa6a0fbde120fbce78ad374650510923d5f2d0950bbfb0
6
+ metadata.gz: cbc8043c74d9b25e1d5e1e09206309378265b27a20fee8c4de1b7084604dd08f708982ac05c258e0fc7e1c001665518cea0010a54d0461c6c6a999a1ad84b3fc
7
+ data.tar.gz: def0bbc31585aff968b15e326c2dfba3e519b31f73fff9b3cae9826764a5fbd1bd7a3cd36acf94b939cafe18650b5b860a1656c9e9ef7a56809ec44720370370
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- turbine_rb (0.2.3)
4
+ turbine_rb (0.2.5)
5
5
  grpc (~> 1.48)
6
6
  hash_dot (~> 2.5.0)
7
7
 
@@ -17,7 +17,7 @@ GEM
17
17
  google-protobuf (3.21.12)
18
18
  google-protobuf (3.21.12-x86_64-darwin)
19
19
  google-protobuf (3.21.12-x86_64-linux)
20
- googleapis-common-protos-types (1.4.0)
20
+ googleapis-common-protos-types (1.5.0)
21
21
  google-protobuf (~> 3.14)
22
22
  grpc (1.50.0)
23
23
  google-protobuf (~> 3.21)
@@ -23,20 +23,21 @@ module TurbineRb
23
23
  end
24
24
 
25
25
  def process(records:, process:)
26
+ new_records = records.dup
26
27
  pb_collection = core_server.add_process_to_collection(
27
28
  TurbineCore::ProcessCollectionRequest.new(
28
- collection: Collection.unwrap(records),
29
+ collection: Collection.unwrap(new_records),
29
30
  process: TurbineCore::ProcessCollectionRequest::Process.new(name: process.class.name)
30
31
  )
31
32
  )
32
- records.tap do |r|
33
+ new_records.tap do |r|
33
34
  r.pb_records = process_call(process: process, pb_collection: pb_collection)
34
35
  r.pb_stream = pb_collection.stream
35
36
  end
36
37
  end
37
38
 
38
39
  def process_call(process:, pb_collection:)
39
- return pb_collection if recording?
40
+ return pb_collection.records if recording?
40
41
 
41
42
  process
42
43
  .call(records: TurbineRb::Records.new(pb_collection.records))
@@ -74,13 +75,14 @@ module TurbineRb
74
75
  end
75
76
 
76
77
  def write(records:, collection:, configs: nil)
78
+ new_records = records.dup
77
79
  if records.instance_of?(Collection) # it has been processed by a function, so unwrap back to gRPC collection
78
- records = records.unwrap
80
+ new_records = records.unwrap
79
81
  end
80
82
 
81
83
  req = TurbineCore::WriteCollectionRequest.new(
82
84
  resource: @pb_resource,
83
- sourceCollection: records,
85
+ sourceCollection: new_records,
84
86
  targetCollection: collection
85
87
  )
86
88
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module TurbineRb
4
- VERSION = "0.2.3"
4
+ VERSION = "0.2.5"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: turbine_rb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.3
4
+ version: 0.2.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Meroxa
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-12-15 00:00:00.000000000 Z
11
+ date: 2023-01-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: grpc