rb_snowflake_client 1.0.2 → 1.0.4

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: 33639407ebfa98e2387ad9924304147b18124ac9ff79bb4d7f5c47a1892f6753
4
- data.tar.gz: 5bca13a6847a4203342f0cc021c61cf4628efff0047887d70bb5c1b093ab78f5
3
+ metadata.gz: 360d25c32a7cc3a3604d286a35eabdf11cd42cb766d41ce079756db869f28509
4
+ data.tar.gz: aa32d0ae97fb42712bde20c8cbd700e109568f5700d95917f22cb671dc36e9bf
5
5
  SHA512:
6
- metadata.gz: 0cc917ffaccb66e29484b6c310fb2f799c7d680e67492ba294f045c8d8f9be438486cce544e1d35329249b555cdde6ef74abbb2d27846e8888b451bc1325773c
7
- data.tar.gz: 416aaaf3c12c2fd444dd42b4de01c120469ac9a2dac5da32fe98bc0d892c03c2c0fd1fc4a445a8df19a13140b245fcd69adc5558f33b79aa74c24210e8b1a7ef
6
+ metadata.gz: a92653723f1a69391177a9b7514de5c74985045dab8aeb1d6fc61b5df29d4e33e8ffbb6f420424e2c253a2229f96ee3f616562fa0d735f3529fe33b5b96a58b0
7
+ data.tar.gz: 00e3ea7dae6d516363814967310b8e7b0bc5078bb9f36d2590393c7f03e7ec39de9923baf6bf19d7654d1da8fa9a20ce586f9d9a616dbc6485736cbbdb8753b1
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- rb_snowflake_client (1.0.2)
4
+ rb_snowflake_client (1.0.4)
5
5
  concurrent-ruby (>= 1.2)
6
6
  connection_pool (>= 2.4)
7
7
  dotenv (>= 2.8)
@@ -1,5 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require "net/http"
4
+
3
5
  module RubySnowflake
4
6
  class Client
5
7
  class HttpConnectionWrapper
@@ -11,6 +13,8 @@ module RubySnowflake
11
13
  def start
12
14
  @connection = Net::HTTP.start(@hostname, @port, use_ssl: true)
13
15
  self
16
+ rescue OpenSSL::SSL::SSLError => e
17
+ raise e # let open ssl errors propagate up to get retried
14
18
  rescue StandardError
15
19
  raise ConnectionError.new "Error connecting to server."
16
20
  end
@@ -22,8 +26,10 @@ module RubySnowflake
22
26
 
23
27
  begin
24
28
  connection.request(request)
25
- rescue StandardError => error
26
- raise RequestError.new "HTTP error requesting data", cause: error
29
+ rescue OpenSSL::SSL::SSLError => e
30
+ raise e # let open ssl errors propagate up to get retried
31
+ rescue StandardError
32
+ raise RequestError, "HTTP error requesting data"
27
33
  end
28
34
  end
29
35
 
@@ -136,8 +136,8 @@ module RubySnowflake
136
136
  response = nil
137
137
  connection_pool.with do |connection|
138
138
  request_body = {
139
- "statement" => query, "warehouse" => warehouse,
140
- "database" => database, "timeout" => @query_timeout
139
+ "statement" => query, "warehouse" => warehouse&.upcase,
140
+ "database" => database&.upcase, "timeout" => @query_timeout
141
141
  }
142
142
 
143
143
  response = request_with_auth_and_headers(
@@ -190,7 +190,7 @@ module RubySnowflake
190
190
  request.body = body unless body.nil?
191
191
 
192
192
  Retryable.retryable(tries: @http_retries + 1,
193
- on: RetryableBadResponseError,
193
+ on: [RetryableBadResponseError, OpenSSL::SSL::SSLError],
194
194
  log_method: retryable_log_method) do
195
195
  response = nil
196
196
  bm = Benchmark.measure { response = connection.request(request) }
@@ -1,3 +1,3 @@
1
1
  module RubySnowflake
2
- VERSION = "1.0.2"
2
+ VERSION = "1.0.4"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rb_snowflake_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rinsed
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-01-16 00:00:00.000000000 Z
11
+ date: 2024-01-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: concurrent-ruby