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:
python --versionpip show google-<service> or pip freezefrom google.cloud import bigquery
def test_function(data, context):
client = bigquery.Client()
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!
@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.
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.
@ctivanovich Can you please show the requirements.txt for your Cloud Functions environment?
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.
Most helpful comment
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.