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

BigQuery: Client initiation fails in Google Cloud Functions #8268

Closed
ashuvashu opened this issue Jun 9, 2019 · 4 comments
Closed

BigQuery: Client initiation fails in Google Cloud Functions #8268

ashuvashu opened this issue Jun 9, 2019 · 4 comments
Assignees
Labels
api: bigquery Issues related to the BigQuery API. type: question Request for information or clarification. Not an issue.

Comments

@ashuvashu
Copy link

Thanks for stopping by to let us know something could be better!

PLEASE READ: If you have a support contract with Google, please create an issue in the support console instead of filing on GitHub. This will ensure a timely response.

Please run down the following list and make sure you've tried the usual "quick fixes":

If you are still having issues, please be sure to include as much information as possible:

Environment details

  1. Specify the API at the beginning of the title (for example, "BigQuery: ...")
    General, Core, and Other are also allowed as types
  2. OS type and version
  3. Python version and virtual environment information: python --version
  4. google-cloud- version: pip show google-<service> or pip freeze

Steps to reproduce

  1. Use google-cloud-bigquery in any cloud functions
  2. following code is going to fail

Code example

from google.cloud import bigquery
def test_function(data, context):
  client = bigquery.Client()

Stack trace

File "/env/local/lib/python3.7/site-packages/google/cloud/functions/worker.py", line 383, in run_background_function _function_handler.invoke_user_function(event_object) File "/env/local/lib/python3.7/site-packages/google/cloud/functions/worker.py", line 217, in invoke_user_function return call_user_function(request_or_event) File "/env/local/lib/python3.7/site-packages/google/cloud/functions/worker.py", line 214, in call_user_function event_context.Context(**request_or_event.context)) File "/user_code/main.py", line 11, in upload_bq bq = bigquery.Client() File "/user_code/google/cloud/bigquery/client.py", line 167, in __init__ self._connection = Connection(self, client_info=client_info) File "/user_code/google/cloud/bigquery/_http.py", line 33, in __init__ super(Connection, self).__init__(client, client_info) TypeError: __init__() takes 2 positional arguments but 3 were given

Making sure to follow these steps will guarantee the quickest resolution possible.

Thanks!

@yoshi-automation yoshi-automation added the triage me I really want to be triaged. label Jun 10, 2019
@sduskis sduskis added api: bigquery Issues related to the BigQuery API. type: question Request for information or clarification. Not an issue. and removed triage me I really want to be triaged. labels Jun 11, 2019
@tseaver
Copy link
Contributor

tseaver commented Jun 11, 2019

@ashuvashu You have an out-of-date version of google-cloud-core installed in your environment. google-cloud-bigquery 1.12.0 and later require google-cloud-core >= 1.0.0.

@tseaver tseaver closed this as completed Jun 11, 2019
@ctivanovich
Copy link

ctivanovich commented Jul 10, 2019

I'm getting this error as well, and I have updated all google cloud python libraries. I have google-cloud-core v 1.11.1.

@tseaver
Copy link
Contributor

tseaver commented Jul 10, 2019

@ctivanovich Can you please show the requirements.txt for your Cloud Functions environment?

@j3pic
Copy link

j3pic commented Sep 6, 2019

I have found that this requirements.txt works on a fresh Ubuntu 18.04 install:

google-cloud-bigquery==1.19.0
google-cloud-core==1.0.3

By "works" I mean you can create a BigQuery Client object and obtain a Table object from it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: bigquery Issues related to the BigQuery API. type: question Request for information or clarification. Not an issue.
Projects
None yet
Development

No branches or pull requests

6 participants