Comments (12)
You can't add pycrypto as an external lib, you need to enable it on your appspot via app.yaml: https://cloud.google.com/appengine/docs/python/tools/libraries27
Note that you may need to convert the .p12 key file to a .pem to work on app engine. See this issue for more information.
That said, the recommended way to use this on App Engine is to not use a private key at all but instead to use AppAssertionCredentials
.
from bigquery import get_client
from bigquery import BIGQUERY_SCOPE
from oauth2client.appengine import AppAssertionCredentials
credentials = AppAssertionCredentials(scope=BIGQUERY_SCOPE)
client = get_client('my-project', credentials=credentials)
from bigquery-python.
can you tell me the import password for convert my key.p12 to key.pem.
when google generate the key.p12 it do not give me password
from bigquery-python.
The password defaults to 'notasecret'
from bigquery-python.
Still have error :
Traceback (most recent call last):
File "C:\Program Files\Google\Cloud SDK\google-cloud-sdk\platform\google_appengine\lib\webapp2-2.5.2\webapp2.py", line 1535, in __call__
rv = self.handle_exception(request, response, e)
File "C:\Program Files\Google\Cloud SDK\google-cloud-sdk\platform\google_appengine\lib\webapp2-2.5.2\webapp2.py", line 1529, in __call__
rv = self.router.dispatch(request, response)
File "C:\Program Files\Google\Cloud SDK\google-cloud-sdk\platform\google_appengine\lib\webapp2-2.5.2\webapp2.py", line 1278, in default_dispatcher
return route.handler_adapter(request, response)
File "C:\Program Files\Google\Cloud SDK\google-cloud-sdk\platform\google_appengine\lib\webapp2-2.5.2\webapp2.py", line 1102, in __call__
return handler.dispatch()
File "C:\Program Files\Google\Cloud SDK\google-cloud-sdk\platform\google_appengine\lib\webapp2-2.5.2\webapp2.py", line 572, in dispatch
return self.handle_exception(e, self.app.debug)
File "C:\Program Files\Google\Cloud SDK\google-cloud-sdk\platform\google_appengine\lib\webapp2-2.5.2\webapp2.py", line 570, in dispatch
return method(*args, **kwargs)
File "C:\Users\sheng\PycharmProjects\helloboard\main.py", line 107, in get
results=client.get_query_rows(job_id)
File "C:\Users\sheng\PycharmProjects\helloboard\lib\bigquery\client.py", line 252, in get_query_rows
limit=limit)
File "C:\Users\sheng\PycharmProjects\helloboard\lib\bigquery\client.py", line 962, in _get_query_results
timeoutMs=0).execute()
File "C:\Users\sheng\PycharmProjects\helloboard\lib\apiclient\http.py", line 292, in execute
raise HttpError(resp, content, self.uri)
HttpError: <HttpError 400 when requesting https://www.googleapis.com/bigquery/v2/projects/foretribebigquery/queries/job__xvopSV8jCsxehtLRG6lfOfe2Y0?startIndex=None&alt=json&maxResults=0&timeoutMs=0 returned "Invalid unsigned long value: 'None'.">
from bigquery-python.
Can you post the code you're using which gives this error? Looks like a bad request is happening.
from bigquery-python.
Specifically, the problem is startIndex=None
.
from bigquery-python.
The error is 0 ms second, do you know how to set the second?
I think that is the timeoutMs=0 problem. do you know where to set this time?
INFO 2015-01-29 02:11:32,084 client.py:529] Attempting refresh to obtain initial access_token
INFO 2015-01-29 02:11:32,279 client.py:771] Refreshing access_token
INFO 2015-01-29 02:11:39,181 discovery.py:522] URL being requested: https://www.googleapis.com/bigquery/v2/projects/foretribebigquery/queries?alt=json
WARNING 2015-01-29 02:11:39,250 util.py:132] new_request() takes at most 1 positional argument (2 given)
INFO 2015-01-29 02:11:43,282 discovery.py:522] URL being requested: https://www.googleapis.com/bigquery/v2/projects/foretribebigquery/queries/job_QqtZ34Vlmz3tI3iuICFgQqeNduE?maxResults=0&alt=json&startIndex=0&timeoutMs=0
WARNING 2015-01-29 02:11:43,282 util.py:132] new_request() takes at most 1 positional argument (2 given)
INFO 2015-01-29 02:11:45,499 discovery.py:522] URL being requested: https://www.googleapis.com/bigquery/v2/projects/foretribebigquery/queries/job_QqtZ34Vlmz3tI3iuICFgQqeNduE?maxResults=0&alt=json&startIndex=None&timeoutMs=0
WARNING 2015-01-29 02:11:45,499 util.py:132] new_request() takes at most 1 positional argument (2 given)
ERROR 2015-01-29 02:11:46,950 webapp2.py:1552] <HttpError 400 when requesting https://www.googleapis.com/bigquery/v2/projects/foretribebigquery/queries/job_QqtZ34Vlmz3tI3iuICFgQqeNduE?maxResults=0&alt=json&startIndex=None&timeoutMs=0 returned "Invalid unsigned long value: 'None'.">
from bigquery-python.
I use the basic solution of your example:
QUERY = "SELECT * FROM [testdata.zip_code] LIMIT 1000"
class JsonHandler(webapp2.RequestHandler):
def get(self):
client=bigquery.get_client(project_id, service_account=service_email, private_key_file=key, readonly=True)
job_id, _results = client.query(QUERY)
complete,row_count=client.check_job(job_id)
results=client.get_query_rows(job_id)
self.response.headers['Content-Type'] = 'application/json'
self.response.out.write(json.dump(results))
from bigquery-python.
What happens if you try:
client.get_query_rows(job_id, offset=0)
from bigquery-python.
it works, but as the maxResult=0, it just give me 0 result, can you tell me how to set the maxResult variable?
from bigquery-python.
The limit
kwarg should control how many results are returned.
On Wed, Jan 28, 2015, 9:07 PM thinksource [email protected] wrote:
it works, but as the maxResult=0, it just give me 0 result, can you tell
me how to set the maxResult variable?—
Reply to this email directly or view it on GitHub
#43 (comment)
.
from bigquery-python.
Thank you it works
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.