GeezerVison is showing github.com — "Empty or missing scope not allowed" in load_data_by_post · Issue #126 · GoogleCloudPlatform/python-docs-samples
"Empty or missing scope not allowed" in load_data_by_post #126Labels 🚨This issue needs some love.triage meI really want to be triaged. DescriptionHello
I had an exception "Empty or missing scope not allowed" when running the sample load_data_by_post.
I fixed it by creating the scope after getting credentials :
credentials = GoogleCredentials.get_application_default()
scope = ['https://www.googleapis.com/auth/bigquery']
credentials = credentials.create_scoped(scope)
Regards Activityjerjou commented on Oct 15, 2015 Thanks for the bug report! I'm having trouble reproducing - the discovery.build() call in the line following, that creates the bigquery service object, should have filled in the scope for you (though what you did is perfectly valid as well).
Do you know what version of the google-api-python-client library you're using?
Also - what environment are you running the code in? (eg local dev, google compute engine, app engine, etc)
It looks like the code to automatically fill in the scope was added on 05/2014, which should be in pip, etc.. theacodes commented on Oct 15, 2015 It may be that because it's using the http client directly, instead of the service, that the proper scope isn't being used. Falydoor commented on Oct 15, 2015 I'm using the version 1.3.2 for the google-api-python-client and I'm on a local dev environment.
I'm loading data into my BigQuery project using this sample in python.
And I had other issues that I fixed by comparing the POST request who was made in the BigQuery web client and the one in this sample.
If you have time, you can check my commit here because I had to do some changes (the big one was to add a "\n" before the last boundary). jerjou commented on Oct 15, 2015 Oh weird. I guess it's only using the service object to poll for the job status. I wonder why the sample is working for me... anyway, will update. theacodes commented on Oct 15, 2015 preferably, we should find a way to make this sample not use raw POST
request (this is a really ugly sample). I know I filed a bug for this
somewhere.
On Thu, Oct 15, 2015 at 1:15 PM Jerjou [email protected] wrote:
Oh weird. I guess it's only using the service object to poll for the job
status. I wonder why the sample is working for me... anyway, will update.
—
Reply to this email directly or view it on GitHub
#126 (comment)
.
jerjou commented on Oct 15, 2015 Okay- updated the sample to actually use the python sdk the way I had originally thought it was being used ^_^; This should hopefully make the scope issue obsolete.
Will update the relevant doc as well.
MetadataMetadata🚨This issue needs some love.triage meI really want to be triaged. DevelopmentNo branches or pull requestsIssue actions
|