multiwoven-integrations 0.8.2 → 0.8.3

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: 150cea6d10255927e0dd613009ec413734caf62b710ca6d804adcba446a60445
4
- data.tar.gz: 3ab02e6bf9c2796078d8e83d6ea9ed9646765d74ed7b978315171bcf1bbd6f4a
3
+ metadata.gz: 5328da16858cd290955a6b993a1ee19285490298eeab3573b8ad55b3dacf7258
4
+ data.tar.gz: ef061954be00b3a90b5927f33e2633b05267968036123e743d5e3438ab4b18fd
5
5
  SHA512:
6
- metadata.gz: b507d56cc8c96241caf483c7d2e8b2d7e04fdfe2e433a3f6cd4fede2a764f1787959d8689419ae2a43971c1ae86bb396bda82fdb82ee9921d8f32146ffca107a
7
- data.tar.gz: 6b85d8ebbc608da63ba165a65b99d0c8dd663560be01a0c32d1ec3bc30907ff515bc0ed2a151d2b943108a18405f9b8cb7c5555c473e1d1be8653013e7ddf150
6
+ metadata.gz: 5a74373e13a6a7f25385e675f8bad255383bfb937f60cb5f78b11512f4bcce749fa15da8f3c63530feeb0edfb5594a6270e857bc0d8975396de09a69f2ee9463
7
+ data.tar.gz: a3262d0ab25b5c7bc3d69f2499068c7fee1a7116c3fe07b23db26177b00e2572e3b721383ed70d2ab9118bf3c144af1b89cb6ce2b2c37f9081a0a18df12e7db5
@@ -40,7 +40,7 @@ module Multiwoven
40
40
  MS_EXCEL_TABLE_ROW_WRITE_API = "https://graph.microsoft.com/v1.0/drives/%<drive_id>s/items/%<item_id>s/"\
41
41
  "workbook/worksheets/%<sheet_name>s/tables/%<table_name>s/rows"
42
42
  MS_EXCEL_TABLE_API = "https://graph.microsoft.com/v1.0/drives/%<drive_id>s/items/%<item_id>s/workbook/"\
43
- "worksheets/sheet/tables?$select=name"
43
+ "worksheets/%<sheet_name>s/tables?$select=name"
44
44
  MS_EXCEL_FILES_API = "https://graph.microsoft.com/v1.0/drives/%<drive_id>s/root/children"
45
45
  MS_EXCEL_WORKSHEETS_API = "https://graph.microsoft.com/v1.0/drives/%<drive_id>s/items/%<item_id>s/"\
46
46
  "workbook/worksheets"
@@ -49,8 +49,7 @@ module Multiwoven::Integrations::Destination
49
49
  excel_files = get_file(token, drive_id)
50
50
  worksheet = excel_files.find { |file| file[:name] == file_name }
51
51
  item_id = worksheet[:id]
52
-
53
- table = get_table(token, drive_id, item_id)
52
+ table = get_table(token, drive_id, item_id, sheet_name)
54
53
  write_url = format(MS_EXCEL_TABLE_ROW_WRITE_API, drive_id: drive_id, item_id: item_id, sheet_name: sheet_name,
55
54
  table_name: table["name"])
56
55
  payload = { values: records.map(&:values) }
@@ -69,8 +68,8 @@ module Multiwoven::Integrations::Destination
69
68
  JSON.parse(response.body)["id"]
70
69
  end
71
70
 
72
- def get_table(token, drive_id, item_id)
73
- table_url = format(MS_EXCEL_TABLE_API, drive_id: drive_id, item_id: item_id)
71
+ def get_table(token, drive_id, item_id, sheet_name)
72
+ table_url = format(MS_EXCEL_TABLE_API, drive_id: drive_id, item_id: item_id, sheet_name: sheet_name)
74
73
  response = Multiwoven::Integrations::Core::HttpClient.request(
75
74
  table_url,
76
75
  HTTP_GET,
@@ -114,9 +113,14 @@ module Multiwoven::Integrations::Destination
114
113
  headers: auth_headers(token)
115
114
  )
116
115
  sheets_data = JSON.parse(sheet_response.body)
116
+ column_names = if sheets_data.key?("error")
117
+ ["Column A"]
118
+ else
119
+ sheets_data["values"].first
120
+ end
117
121
  result << {
118
122
  sheet_name: sheet_name,
119
- column_names: sheets_data["values"].first
123
+ column_names: column_names
120
124
  }
121
125
  end
122
126
  result
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "request_rate_limit": 6000,
3
3
  "request_rate_limit_unit": "minute",
4
- "request_rate_concurrency": 10,
4
+ "request_rate_concurrency": 1,
5
5
  "streams": []
6
6
  }
7
7
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  module Multiwoven
4
4
  module Integrations
5
- VERSION = "0.8.2"
5
+ VERSION = "0.8.3"
6
6
 
7
7
  ENABLED_SOURCES = %w[
8
8
  Snowflake
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: multiwoven-integrations
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.2
4
+ version: 0.8.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Subin T P