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 +4 -4
- data/Gemfile.lock +1 -1
- data/lib/ruby_snowflake/client/http_connection_wrapper.rb +8 -2
- data/lib/ruby_snowflake/client.rb +3 -3
- data/lib/ruby_snowflake/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 360d25c32a7cc3a3604d286a35eabdf11cd42cb766d41ce079756db869f28509
|
4
|
+
data.tar.gz: aa32d0ae97fb42712bde20c8cbd700e109568f5700d95917f22cb671dc36e9bf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a92653723f1a69391177a9b7514de5c74985045dab8aeb1d6fc61b5df29d4e33e8ffbb6f420424e2c253a2229f96ee3f616562fa0d735f3529fe33b5b96a58b0
|
7
|
+
data.tar.gz: 00e3ea7dae6d516363814967310b8e7b0bc5078bb9f36d2590393c7f03e7ec39de9923baf6bf19d7654d1da8fa9a20ce586f9d9a616dbc6485736cbbdb8753b1
|
data/Gemfile.lock
CHANGED
@@ -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
|
26
|
-
raise
|
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) }
|
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.
|
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-
|
11
|
+
date: 2024-01-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: concurrent-ruby
|