-
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
Feels like we've added a bit more complexity to the datastore API, comments? #647
Comments
@jgeewax We spent a lot of work to get rid of the high-level concept of dataset. The philosophy was that we should make the objects and their constructors easier to use and that "learning" another class was overkill when the dataset was a) just a string and b) something that was a single-valued constant for most users. |
That's going to be a really big problem when Datastore exposes multiple datasets per project... |
SETUP
Put a single entity
Put a bunch of entities
Get an entity
A couple comments about "what I'd like to write":
preferable to
I am completely boggled by this.
Finally, as an aside, I submitted a PR to remove the list wrapping requirement for single arguments #623 , but if you want to support python 27 and 26 then you need to use |
@jgeewax just wanted to add that I agree with the premise of this issue. I'm writing the samples for the landing page as we speak, and it's awkward to say the least. |
Re "why
|
I thought the goal was to move away from the DB implementations, not take queues from their implementation. If the goal is to cover different use cases the syntax is going to be different. RE:
that this was how you meant it, and then it would be implemented by pulling the entities of a certain kind and searching for the right id. EDIT: If you really wanted to add extra sugar on top of key, you could do something like
|
I don't recall ever saying or hearing "we're going to avoid everything done in I think the I could be wrong here. Either way, I don't think we should take a hard-line stance of "no stuff that was in |
I think that is going to be more of a trouble than a convenience TBH. To quote Zen of Python Before the major restructuring |
@jgeewax Can we close this out? The core issues were
Both of those have been implemented. Anything remaining can be broken off into a smaller more digestible bug for discussion? |
SGTM |
…#647) * docs: added google.api.field_behavior for some fields in audio_config PiperOrigin-RevId: 546447788 Source-Link: googleapis/googleapis@370fc4c Source-Link: googleapis/googleapis-gen@f886e2a Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiZjg4NmUyYTJiYTFlYjg3YTA4YjY5MTI3ZmFhOWY4ODJmYTA4Mzc2YSJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * docs: added google.api.field_behavior for some fields in audio_config PiperOrigin-RevId: 546447860 Source-Link: googleapis/googleapis@52535ce Source-Link: googleapis/googleapis-gen@14c79ff Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMTRjNzlmZjdjYzI4MDM3YTk5MjJkN2UyMjEzMWViY2I1ODdlMTE2NiJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --------- Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
Hi guys,
I was reviewing the "state of the world" of the datastore API, and found a few things that seem (to me at least) a bit more complicated than they should be.
A bit of this comes from the authentication stuff (which we have another open bug for) but I wanted to bring up a few things for discussion... If this issue gets out of control, we can move the discussion elsewhere, but I wanted to kick things off:
Create a new Person entity in the Datastore
What I have to write
What I'd like to write
Key differences
set_defaults()
(there's another issue open for this I believe)datastore.Kind('Person').get_entity()
?).put
not requiring a list for a single entityGet an existing Person (123) from the Datastore
What I have to write
What I'd like to write
Key differences
set_defaults
(Not hugely concerned about this use case, but wanted to toss it out)
Create a new Person using a specific set of credentials (
/home/creds.json
) to talk to a specific dataset ('my-dataset'
) in the Datastore(Being looked into in PR #641)
What I have to write
(This is a best guess... I don't know if this code is even right... And even so, this code won't do the same thing if you ran it on App Engine because of the order of evaluation here: http://googlecloudplatform.github.io/gcloud-python/latest/gcloud-api.html#gcloud.credentials.get_credentials )
What I'd like to write
Key differences
datastore
would/cc @tseaver @dhermes @pcostell
The text was updated successfully, but these errors were encountered: