Performing a client query w/ Ruby warnings enabled and no params passed results in a warning from ruby re: an empty hash as right-hand argument to %:
vendor/ruby/2.7.0/gems/influxdb-0.8.1/lib/influxdb/query/builder.rb:12: warning: too many arguments for format string
Triggering this warning in plain-old ruby:
$ irb -w
irb(main):001:0> "foo" % {}
(irb):1: warning: too many arguments for format string
=> "foo"
Adding a params.empty? check to InfluxDB::Query::Builder#build() seems to address the warning:
params.empty? ? query : query % params
The warning is not a bug per se, but when running code w/ many queries and warnings enabled, such as in a test suite, it can result in diminished signal to noise that obscures warnings from application code.
Performing a client query w/ Ruby warnings enabled and no params passed results in a warning from ruby re: an empty hash as right-hand argument to
%
:Triggering this warning in plain-old ruby:
Adding a
params.empty?
check toInfluxDB::Query::Builder#build()
seems to address the warning:The warning is not a bug per se, but when running code w/ many queries and warnings enabled, such as in a test suite, it can result in diminished signal to noise that obscures warnings from application code.