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

'Client' object has no attribute 'run_sync_query' #27

Closed
aaronjanse opened this issue Nov 5, 2017 · 14 comments
Closed

'Client' object has no attribute 'run_sync_query' #27

aaronjanse opened this issue Nov 5, 2017 · 14 comments

Comments

@aaronjanse
Copy link

First of all, thank you so much for building this package.
I'm excited to start using it, but it has been crashing for me on every query run:

coding@Aarons-MBP pypinfo (master)$ pypinfo django date
Traceback (most recent call last):
  File "/usr/local/bin/pypinfo", line 11, in <module>
    load_entry_point('pypinfo==5.0.0', 'console_scripts', 'pypinfo')()
  File "/usr/local/lib/python3.6/site-packages/click/core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/click/core.py", line 697, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python3.6/site-packages/click/core.py", line 1043, in invoke
    return Command.invoke(self, ctx)
  File "/usr/local/lib/python3.6/site-packages/click/core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python3.6/site-packages/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/click/decorators.py", line 17, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/pypinfo/cli.py", line 89, in pypinfo
    query = client.run_sync_query(built_query)
AttributeError: 'Client' object has no attribute 'run_sync_query'

I tried python2, updating gcloud, etc. to no avail.

@ofek ofek closed this as completed in 65257d5 Nov 5, 2017
@aaronjanse
Copy link
Author

Thanks

@ofek
Copy link
Owner

ofek commented Nov 5, 2017

This is fixed in 6.0.0, thank you! Google released a new version of their BigQuery lib.

@aishgrt1
Copy link

I am using it using Ananconda, but still shows the same error for me. I have the updated version of the Google Big Query:

AttributeError: 'Client' object has no attribute 'run_sync_query'

@ofek
Copy link
Owner

ofek commented Jan 26, 2018

@aishgrt1 Can you please show me the output of pip freeze?

@aishgrt1
Copy link

aishgrt1 commented Jan 26, 2018

These are the google related packages:

google-api-core           0.1.1                    py36_1    conda-forge
google-api-python-client  1.6.4                      py_0    conda-forge
google-auth               1.2.1                      py_0    conda-forge
google-cloud-bigquery     0.29.0                     py_0    conda-forge
google-cloud-core         0.28.0                     py_0    conda-forge
google-resumable-media    0.3.1                      py_0    conda-forge
googleapis-common-protos  1.5.3                    py36_0    conda-forge

@ofek
Copy link
Owner

ofek commented Jan 26, 2018

I need to see the version of pypinfo.

@aishgrt1
Copy link

There is no package called pypinfo

@aishgrt1
Copy link

print(pypinfo.version)
8.0.0

@ofek
Copy link
Owner

ofek commented Jan 27, 2018

Do pypinfo --version

@aishgrt1
Copy link

it's 8.0.0

@aishgrt1
Copy link

from google.cloud import bigquery
client = bigquery.Client()
dir(client)
['SCOPE', '_SET_PROJECT', 'class', 'delattr', 'dict', 'dir', 'doc', 'eq', 'format', 'ge', 'getattribute', 'getstate', 'gt', 'hash', 'init', 'init_subclass', 'le', 'lt', 'module', 'ne', 'new', 'reduce', 'reduce_ex', 'repr', 'setattr', 'sizeof', 'str', 'subclasshook', 'weakref', '_call_api', '_connection', '_credentials', '_determine_default', '_do_multipart_upload', '_do_resumable_upload', '_get_query_results', '_http', '_http_internal', '_initiate_resumable_upload', 'cancel_job', 'copy_table', 'create_dataset', 'create_rows', 'create_rows_json', 'create_table', 'dataset', 'delete_dataset', 'delete_table', 'extract_table', 'from_service_account_json', 'get_dataset', 'get_job', 'get_table', 'insert_rows', 'insert_rows_json', 'job_from_resource', 'list_dataset_tables', 'list_datasets', 'list_jobs', 'list_partitions', 'list_projects', 'list_rows', 'list_tables', 'load_table_from_file', 'load_table_from_uri', 'project', 'query', 'update_dataset', 'update_table']

So the version of google-cloud-bigquery is 0.29.0 , and the list of functions, doesn't contain run_sync_query

@aishgrt1
Copy link

the "run_sync_query" has been changed to "query" in 0.29.0 version

@ofek
Copy link
Owner

ofek commented Jan 27, 2018

The error implies pypinfo<6.0.0 but I don't know how that is possible.

@ofek
Copy link
Owner

ofek commented Jan 29, 2018

Try re-installing pypinfo.

REestwick pushed a commit to REestwick/pypinfo that referenced this issue Apr 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants