-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
with Batch() as batch: clause throws AttributeError regarding Connection object #865
Comments
You are calling You need a datastore connection for interacting with the datastore from gcloud import datastore
datastore_cnxn = datastore.get_connection() You can instead just let the implicit behavior take over and just execute with datastore.Batch() as batch:
... Sorry I didn't try to dig deeper into the code snippet, it is a bit of a mouthful. |
@charlesbclifford I'm going to close out. The issue is expected since Please re-open if you are still having issues or have remaining questions. |
Thanks for the fix, which I implemented. Now, using the correct datastore connection, this error is thrown: There's got to be some other object property I've corrupted. On Friday, May 8, 2015, Danny Hermes notifications@github.com wrote:
Charles B. Clifford |
Can you try making a datastore request with a short snippet and report back the stack trace? For example from gcloud import datastore
# Make sure proper env. vars. are set for config
q = datastore.Query('Foo')
print list(q.fetch()) I'm going to guess you are getting the 503 error because you haven't turned on the Cloud Datastore service yet in the APIs console. Can you make sure it is turned on? |
In the Google Developers Console, of a project for which I am an When I import datastore, set the Datastore default data set id, and the Are there more than the above 2 defaults which must be set? My code must be On Friday, May 8, 2015, Danny Hermes notifications@github.com wrote:
Charles B. Clifford |
Can you post a stack trace? What OS are you using? How are you setting your environment variables (or your defaults in code?) What form of auth are you using? |
I am gathering together all of the requested info and will post the info Thanks. On Friday, May 8, 2015, Danny Hermes notifications@github.com wrote:
Charles B. Clifford |
Did you intend to open a new issue? |
Also, what happens when you look at the Datastore UI for your project (https://console.developers.google.com/project/_/datastore/stats , then choose your project from the list) |
Just installed
gcloud-python
this past Tuesday, and this is my 1st time using it. Shown below is the code that is throwing anAttributeError
regarding theConnection
object. The code is about a method which builds a batch of new entities which are intended to loaded into Datastore.After the last
batch.put(_ENTITY)
statement executes successfully, and thewith datastore.batch.Batch(connection=connection) as batch:
clause completes, this error is thrownI'm not sure why the reference to the
commit
attribute is made relative to the Connection object, and not to the Batch object.Here's the abbreviated method call that throws the
AttributeError
regarding the Connection object:Any suggestions to get past this bug are appreciated.
The text was updated successfully, but these errors were encountered: