Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Model version setting option and Faraday deprecation fixes #75

Merged
merged 4 commits into from
Dec 22, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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