multiwoven-integrations 0.7.2 → 0.7.3

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: 77c1f29e452cbeee226a06909b5bf589061063a051bc3c73ac73ec1d2748b159
4
- data.tar.gz: d4b47377d27c931947cf15589723ba397d4a2e500c600ada8fad308f3a82e0d6
3
+ metadata.gz: 693440a73b76750eaccde5f6f31740a7545330d279bc429c837f9f7fb818f8bc
4
+ data.tar.gz: 6ad84800b7397a69c2b4db6698044379b0514840776a893ebbe996e62b8b7f4e
5
5
  SHA512:
6
- metadata.gz: 6d81300b2ed2fa1dc066b29a3af4096ef5a85045e18f84d708bec9f7f12182fbd2ee013c7bb797de6a2dfa23494a7e07fbb802498e6c2426e6ee714bc8465508
7
- data.tar.gz: 2f65fd9330887945df04375914b8dddfe1170c40c16fb5575cba642ffae943d36223c42c2e85f50f89796e5f2e9cc82df5878bb1923936f54c544ee725f58535
6
+ metadata.gz: d57f467335ccd3685a58c13662e741c87408d11ca1043258d63e2ee76ee69794491e43fce2b42bd2ba15947974aa8ac40a2c734db51efe2ed328722d8e674b4b
7
+ data.tar.gz: 5b520ab5ff9f6168ac9cbfa750ee1a1bb02063f84ac7044ed9eb95611b13659b674ae02aece579e30921a3439efb1789a5f98f548ce65e74b030111264ead7e8
@@ -153,13 +153,15 @@ module Multiwoven
153
153
 
154
154
  # Batch has a limit of sending 2MB data. So creating a chunk of records to meet that limit
155
155
  def process_record_chunks(records, sync_config)
156
+ log_message_array = []
156
157
  write_success = 0
157
158
  write_failure = 0
158
159
 
159
160
  records.each_slice(MAX_CHUNK_SIZE) do |chunk|
160
161
  values = prepare_chunk_values(chunk, sync_config.stream)
161
- update_sheet_values(values, sync_config.stream.name)
162
+ request, response = *update_sheet_values(values, sync_config.stream.name)
162
163
  write_success += values.size
164
+ log_message_array << log_request_response("info", request, response)
163
165
  rescue StandardError => e
164
166
  handle_exception(e, {
165
167
  context: "GOOGLE_SHEETS:RECORD:WRITE:EXCEPTION",
@@ -168,9 +170,9 @@ module Multiwoven
168
170
  sync_run_id: sync_config.sync_run_id
169
171
  })
170
172
  write_failure += chunk.size
173
+ log_message_array << log_request_response("error", request, e.message)
171
174
  end
172
-
173
- tracking_message(write_success, write_failure)
175
+ tracking_message(write_success, write_failure, log_message_array)
174
176
  end
175
177
 
176
178
  # We need to format the data to adhere to google sheets API format. This converts the sync mapped data to 2D array format expected by google sheets API
@@ -199,19 +201,14 @@ module Multiwoven
199
201
  )
200
202
 
201
203
  # TODO: Remove & this is added for the test to pass we need
202
- @client&.batch_update_values(@spreadsheet_id, batch_update_request)
204
+ response = @client&.batch_update_values(@spreadsheet_id, batch_update_request)
205
+ [batch_update_request, response]
203
206
  end
204
207
 
205
208
  def load_catalog
206
209
  read_json(CATALOG_SPEC_PATH)
207
210
  end
208
211
 
209
- def tracking_message(success, failure)
210
- Multiwoven::Integrations::Protocol::TrackingMessage.new(
211
- success: success, failed: failure
212
- ).to_multiwoven_message
213
- end
214
-
215
212
  def delete_extra_sheets(sheet_ids)
216
213
  # Leave one sheet intact as a spreadsheet must have at least one sheet.
217
214
  # Delete all other sheets.
@@ -2,7 +2,7 @@
2
2
 
3
3
  module Multiwoven
4
4
  module Integrations
5
- VERSION = "0.7.2"
5
+ VERSION = "0.7.3"
6
6
 
7
7
  ENABLED_SOURCES = %w[
8
8
  Snowflake
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: multiwoven-integrations
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.2
4
+ version: 0.7.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Subin T P
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-08-06 00:00:00.000000000 Z
11
+ date: 2024-08-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport