Google-cloud-ruby: [BigQuery] Client query method throws ArgumentError: wrong number of arguments (given 3, expected 2) after upgrading to 1.26.0

Created on 18 Jan 2021  路  3Comments  路  Source: googleapis/google-cloud-ruby

Environment details

  • OS: macOS v11.1 build 20C69
  • Ruby version: 2.7.2
  • Gem name and version: google-cloud-bigquery (1.26.0)

Steps to reproduce

  1. Run a SQL command with the ruby client with the following params:
    ruby @client.query( "SELECT * FROM table_x", standard_sql: true, params: {} )
  2. The client will throw ArgumentError: wrong number of arguments (given 3, expected 2) on this line
    ruby gapi = service.query_job updater.to_gapi # will throw ArgumentError: wrong number of arguments (given 3, expected 2) Job.from_gapi gapi, service
    Note: Before upgrading to version 1.26.0 everything worked fine.

Full backtrace

pry(#<Google::Cloud::Bigquery::Project>)> service.query_job updater.to_gapi
ArgumentError: wrong number of arguments (given 3, expected 2)
from /Users/robi/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/google-api-client-0.52.0/lib/google/apis/core/base_service.rb:128:in `initialize'
bigquery question

Most helpful comment

Apologies for the hiccup here. There appears to be a conflict with the older google-api-client gem. Try updating to the fixed version 0.53.0 of google-api-client. That should fix the issue.

Even better, though, remove google-api-client from your bundle altogether if you can. We have recently released individual gems for each client, so you can install just the clients you are using, and should no longer need google-api-client (which is enormous). For example, if you are using the Drive V3 client, install google-apis-drive_v3.

All 3 comments

Apologies for the hiccup here. There appears to be a conflict with the older google-api-client gem. Try updating to the fixed version 0.53.0 of google-api-client. That should fix the issue.

Even better, though, remove google-api-client from your bundle altogether if you can. We have recently released individual gems for each client, so you can install just the clients you are using, and should no longer need google-api-client (which is enormous). For example, if you are using the Drive V3 client, install google-apis-drive_v3.

@robikovacs Closing now since the release of google-api-client/v0.53.0 should resolve this issue. But please reopen if you still have any trouble. Thanks for reporting this.

Thanks, @dazuma, @quartzmo, for the quick response and for the advice, it worked. Much appreciated!

Was this page helpful?
0 / 5 - 0 ratings