Skip to content

Commit

Permalink
Merge pull request #75 from evgeniy-b/1-0-1-fixes
Browse files Browse the repository at this point in the history
Model version setting option and Faraday deprecation fixes
  • Loading branch information
takezoe authored Dec 22, 2021
2 parents 23513ab + 5c20266 commit 4cdd21f
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
4 changes: 2 additions & 2 deletions lib/trino/client/faraday_client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def self.faraday_client(options)

faraday = Faraday.new(faraday_options) do |faraday|
if options[:user] && options[:password]
faraday.basic_auth(options[:user], options[:password])
faraday.request(:basic_auth, options[:user], options[:password])
end
if options[:follow_redirect]
faraday.use FaradayMiddleware::FollowRedirects
Expand Down Expand Up @@ -123,7 +123,7 @@ def self.faraday_ssl_options(options)

def self.optional_headers(options)
usePrestoHeader = false
if v = options[:model_version] && v < 351
if options[:model_version] && options[:model_version] < 351
usePrestoHeader = true
end

Expand Down
2 changes: 1 addition & 1 deletion lib/trino/client/statement_client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def initialize(faraday, query, options, next_uri=nil)
@state = :running
@retry_timeout = options[:retry_timeout] || 120
if model_version = @options[:model_version]
@models = ModelVersions.const_get("V#{model_version.gsub(".", "_")}")
@models = ModelVersions.const_get("V#{model_version.to_s.gsub(".", "_")}")
else
@models = Models
end
Expand Down
1 change: 0 additions & 1 deletion trino-client.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ Gem::Specification.new do |gem|
gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
gem.require_paths = ["lib"]
gem.has_rdoc = false

gem.required_ruby_version = ">= 1.9.1"

Expand Down

0 comments on commit 4cdd21f

Please sign in to comment.