Comments (21)
Hey,
I'm facing exactly the problem as the above. Could someone help us out? @tylertreat
from bigquery-python.
@kumarabd use gcloud and official library instead
from bigquery-python.
@imzisy Worked perfect!! thanks 👍
from bigquery-python.
You client is in read only mode. Fix it!
from bigquery-python.
Hi, any update on this issue? I am facing the same problem. Other than turning to gcloud, is there any solution yet? (I set readonly as False already) @tylertreat @imzisy
from bigquery-python.
@bowen0603 when do you see No handlers could be found for logger "bigquery.client"
?
from bigquery-python.
It is when I am calling: created = client.create_table('dataset', 'my_table', schema)
The schema is a given example:
schema = [
{'name': 'foo', 'type': 'STRING', 'mode': 'nullable'},
{'name': 'bar', 'type': 'FLOAT', 'mode': 'nullable'}
]
I then check the table as well.
exists = client.check_table('dataset', 'my_table')
It turns out both created and exists are False.
I executed the same code as above, the only difference is I only use json key for get_client, not PEM. Could you give me any help on this? Thanks! @tylertreat
from bigquery-python.
Hi @tylertreat, any update on this one? Could you please help me out? I have been stuck on this for a while. Thanks a lot!
from bigquery-python.
Hello @bowen0603, just wondering if you had added 'readonly = False' or 'swallow_results = False' to your get_client function call? Referencing #44 (comment) it seems like the library uses readonly = True by default and you have to specify that you want to be able to write.
from bigquery-python.
@bowen0603 Can you show us a minimal code which reproduce this case?
I tried following
# code fragment from client.py about logging
`--> cat logtest.py
from logging import getLogger, NullHandler
logger = getLogger('bigquery.client')
logger.addHandler(NullHandler())
logger.info("hey")
print('OK')
`--> python --version
Python 3.5.1
`--> python ./logtest.py
OK
## switch to python2
`--> pyenv shell 2.7.5
`--> python --version
Python 2.7.5
`--> python ./logtest.py
OK
but I have no error.
from bigquery-python.
Yes, I did set readonly to False.
client = get_client(project_id, service_account=service_account, json_key_file=json_key, readonly=False) => this one works.
created = client.create_table('bowen_editor_attachments', 'my_table', schema) => this one gives me the "No handers could be found for logger "bigquery.client"".
Thanks for replying me :) @ciaran-blewitt-webjet @hagino3000
from bigquery-python.
I created same code as next
# test.py
from bigquery import get_client
client = get_client(
'MYPROJECT',
json_key_file='MY_JSON_KEY_PATH',
readonly=False
)
created = client.create_table('tmp_7day', 'libtest', [{'name': 'id', 'type': 'string'}])
print('OK')
Then, I prepare clean python environment
`--> cat /etc/redhat-release
CentOS Linux release 7.1.1503 (Core)
`--> virtualenv .
New python executable in ./bin/python
Installing Setuptools........................................................................................................................
......................................................................................................done.
Installing Pip...............................................................................................................................
.............................................................................................................................................
.........................................................done.
`--> ./bin/pip install BigQuery-Python
Downloading/unpacking BigQuery-Python
Downloading BigQuery-Python-1.10.0.tar.gz
Running setup.py egg_info for package BigQuery-Python
Downloading/unpacking google-api-python-client (from BigQuery-Python)
Downloading google-api-python-client-1.6.1.tar.gz (46kB): 46kB downloaded
Running setup.py egg_info for package google-api-python-client
warning: no files found matching '*.json' under directory 'apiclient'
warning: no files found matching 'README'
warning: no files found matching 'FAQ'
warning: no files found matching 'setpath.sh'
Downloading/unpacking httplib2 (from BigQuery-Python)
Downloading httplib2-0.9.2.zip (210kB): 210kB downloaded
Running setup.py egg_info for package httplib2
Downloading/unpacking python-dateutil (from BigQuery-Python)
Downloading python-dateutil-2.6.0.tar.gz (258kB): 258kB downloaded
Running setup.py egg_info for package python-dateutil
warning: no previously-included files matching '__pycache__' found anywhere in distribution
warning: no previously-included files matching '*.py[co]' found anywhere in distribution
Downloading/unpacking oauth2client>=1.5.0,<5.0.0dev (from google-api-python-client->BigQuery-Python)
Downloading oauth2client-4.0.0.tar.gz (72kB): 72kB downloaded
Running setup.py egg_info for package oauth2client
warning: no previously-included files matching '*' found under directory 'tests'
Downloading/unpacking six>=1.6.1,<2dev (from google-api-python-client->BigQuery-Python)
Downloading six-1.10.0.tar.gz
Running setup.py egg_info for package six
no previously-included directories found matching 'documentation/_build'
Downloading/unpacking uritemplate>=3.0.0,<4dev (from google-api-python-client->BigQuery-Python)
Downloading uritemplate-3.0.0.tar.gz
Running setup.py egg_info for package uritemplate
no previously-included directories found matching 'docs/_build'
warning: no previously-included files matching '*.py[cdo]' found anywhere in distribution
warning: no previously-included files matching '__pycache__' found anywhere in distribution
warning: no previously-included files matching '*.so' found anywhere in distribution
warning: no previously-included files matching '*.pyd' found anywhere in distribution
Downloading/unpacking pyasn1>=0.1.7 (from oauth2client>=1.5.0,<5.0.0dev->google-api-python-client->BigQuery-Python)
Downloading pyasn1-0.1.9.tar.gz (75kB): 75kB downloaded
Running setup.py egg_info for package pyasn1
Downloading/unpacking pyasn1-modules>=0.0.5 (from oauth2client>=1.5.0,<5.0.0dev->google-api-python-client->BigQuery-Python)
Downloading pyasn1-modules-0.0.8.tar.gz
Running setup.py egg_info for package pyasn1-modules
Downloading/unpacking rsa>=3.1.4 (from oauth2client>=1.5.0,<5.0.0dev->google-api-python-client->BigQuery-Python)
Downloading rsa-3.4.2.tar.gz (40kB): 40kB downloaded
Running setup.py egg_info for package rsa
Installing collected packages: BigQuery-Python, google-api-python-client, httplib2, python-dateutil, oauth2client, six, uritemplate, pyasn1,
pyasn1-modules, rsa
Running setup.py install for BigQuery-Python
Running setup.py install for google-api-python-client
warning: no files found matching '*.json' under directory 'apiclient'
warning: no files found matching 'README'
warning: no files found matching 'FAQ'
warning: no files found matching 'setpath.sh'
Running setup.py install for httplib2
Running setup.py install for python-dateutil
warning: no previously-included files matching '__pycache__' found anywhere in distribution
warning: no previously-included files matching '*.py[co]' found anywhere in distribution
Running setup.py install for oauth2client
warning: no previously-included files matching '*' found under directory 'tests'
Running setup.py install for six
no previously-included directories found matching 'documentation/_build'
Running setup.py install for uritemplate
no previously-included directories found matching 'docs/_build'
warning: no previously-included files matching '*.py[cdo]' found anywhere in distribution
warning: no previously-included files matching '__pycache__' found anywhere in distribution
warning: no previously-included files matching '*.so' found anywhere in distribution
warning: no previously-included files matching '*.pyd' found anywhere in distribution
Running setup.py install for pyasn1
Running setup.py install for pyasn1-modules
Running setup.py install for rsa
Installing pyrsa-encrypt-bigfile script to /home/t-nishibayashi/tmp/test/bin
Installing pyrsa-encrypt script to /home/t-nishibayashi/tmp/test/bin
Installing pyrsa-verify script to /home/t-nishibayashi/tmp/test/bin
Installing pyrsa-sign script to /home/t-nishibayashi/tmp/test/bin
Installing pyrsa-priv2pub script to /home/t-nishibayashi/tmp/test/bin
Installing pyrsa-decrypt script to /home/t-nishibayashi/tmp/test/bin
Installing pyrsa-keygen script to /home/t-nishibayashi/tmp/test/bin
Installing pyrsa-decrypt-bigfile script to /home/t-nishibayashi/tmp/test/bin
Successfully installed BigQuery-Python google-api-python-client httplib2 python-dateutil oauth2client six uritemplate pyasn1 pyasn1-modules rsa
Cleaning up...
`--> ./bin/python --version
Python 2.7.5
Then run it
`--> ./bin/python test.py
OK
ummmm.....
@bowen0603
Do you get the error also in a clean environment?
from bigquery-python.
Yeah, I've also been unable to reproduce this issue.
from bigquery-python.
Getting this issue as well. This occurs when I try to run the sample code to insert a number of rows of data into an existing table. The code is exactly the same as @imzisy's above. Anyone resolved it yet?
from bigquery-python.
@niibruce What is your Python version and platform running it?
from bigquery-python.
@hagino3000 Python 2.7 and macOS Sierra.
from bigquery-python.
@niibruce /usr/bin/python
?
from bigquery-python.
@hagino3000 Yes.
from bigquery-python.
@niibruce Thanks
I reproduced this issue with following code and MacOSX python.
`--> ./bin/python
Python 2.7.10 (default, Oct 23 2015, 19:19:21)
[GCC 4.2.1 Compatible Apple LLVM 7.0.0 (clang-700.0.59.5)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>>
from bigquery import get_client
client = get_client(
'MY_PROJECT_NAME',
json_key_file='MY_KEY_PATH',
readonly=False
)
schema = [
{'name': 'id', 'type': 'string'},
{'name': 'one', 'type': 'string'},
{'name': 'two', 'type': 'string'}
]
# Create table
created = client.create_table('tmp_7day', 'libtest4', schema)
print('Table created', created)
# Create table with same name. It will fail
created = client.create_table('tmp_7day', 'libtest4', schema)
print('Table created', created)
print('OK')
Console output
`--> ./bin/python test.py
bigquery.client
('Table created', True)
No handlers could be found for logger "bigquery.client"
('Table created', False)
OK
But this problem has fixed by this commit
from bigquery-python.
@tylertreat This problem will solved by release new version.
from bigquery-python.
This should be addressed in 1.11.0. https://github.com/tylertreat/BigQuery-Python/releases/tag/v1.11.0
from bigquery-python.
Related Issues (20)
- ImportError: cannot import name get_client HOT 6
- Queries results limited HOT 1
- get statistics of the job HOT 1
- specifying dataset location when using create_dataset method HOT 2
- create_table() documentation incorrect HOT 1
- Table expiration time should be a long HOT 1
- Functionality to upload/download file from local to gcs and vice versa
- not working anymore due to KeyError: 'google'
- Get Client with API key
- documentation typo "destination_urls" HOT 1
- bigquery.errors.JobInsertException: Reason:invalid. Message:Table wasel-95b26:com_mysada_news_ANDROID.app_events_20170611 cannot be exported as CSV because it has a nested schema. HOT 1
- get_query_rows offset option fails across pages
- Few typos in documentation HOT 1
- Cannot import get_client
- ImportError: No module named bigquery
- Not getting the full list of datasets when there are more than 50 datasets in the project HOT 1
- Standard SQL support HOT 3
- "Please look into the error stream for more details." HOT 5
- Request had insufficient authentication scopes when creating a table HOT 6
- Is this project still ongoing?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bigquery-python.