Skip to content

BigQuery: Client initiation fails in Google Cloud Functions  #8268

@ashuvashu

Description

@ashuvashu

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!

Metadata

Metadata

Assignees

Labels

api: bigqueryIssues related to the BigQuery API.type: questionRequest for information or clarification. Not an issue.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions