Skip to content
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

dict only datastore put #410

Closed
elibixby opened this issue Dec 9, 2014 · 5 comments
Closed

dict only datastore put #410

elibixby opened this issue Dec 9, 2014 · 5 comments
Assignees
Labels
api: datastore Issues related to the Datastore API. 🚨 This issue needs some love. triage me I really want to be triaged.

Comments

@elibixby
Copy link

elibixby commented Dec 9, 2014

Since I've been working on a TodoMVC demo with gcloud-python, I've been discussing usability with @proppy and thinking it would useful to be able to put data from dictionary form into the datastore directly without instantiating an entity object -- something along the lines of:

dataset = datastore.get_dataset(foo, bar, baz)
dataset.put(('kind', 'root', 'kind', 1),{'name':anakin_skywalker, 'jedi': True, 'sith':True})

This feels more pythonic. As a side note, I'm not really sure why "save" "reload" and "delete" are entity level methods. One can imagine wanting similar entities across multiple datasets without having to instantiate a bunch of objects. Any thoughts on this?

Thanks!

@dhermes
Copy link
Contributor

dhermes commented Dec 9, 2014

Though convenient in some sense, I don't think a stringly typed approach is the way of the Python Jedi here.

There should be one-- and preferably only one --obvious way to do it.

@elibixby
Copy link
Author

I agree, there should be only one. In danger of stepping on some toes by saying it, but there doesn't seem to be much space between ndb and the current gcloud-python. Putting existing data structures as entities and keys is definitely a desired use case quite distinct from ndb. I've forked this repo, and will be trying to rework it into something lighter weight, whether that turns into a new library or gets merged who knows.

@proppy
Copy link
Contributor

proppy commented Dec 11, 2014

I think that's tempting to rely on python native type (tuple and dict), to balance with a higher layer like NDB soon to be compatible with Cloud Datastore.

Most app already have some logic to convert their object to dicts in order to seralize to json, so it seems natural to me for a "low-level" API to have functions that takes a key tuple and a dict and persist them, rather than introducing a new set of Objects, see how mongo does it with Database/Collection and Document for reference.
http://api.mongodb.org/python/current/tutorial.html

I think a generic Entity class like gcloud-python has today, belong more to a base layer in a higher level library like NDB.

@silvolu
Copy link
Contributor

silvolu commented Dec 12, 2014

@elibixby Cool, I think it would be very interesting to see it, and we can definitely merge it back if we have consensus on it!

@dhermes
Copy link
Contributor

dhermes commented Dec 30, 2014

Closing in favor of the API changes which (will) make the constructors easier / more natural feeling.

@elibixby and @proppy did open my eyes to the fact that Entity may not be needed as a class and we can re-evaluate after all the API changes have gone through.

@dhermes dhermes closed this as completed Dec 30, 2014
@jgeewax jgeewax added the api: datastore Issues related to the Datastore API. label Jan 30, 2015
@jgeewax jgeewax modified the milestone: Datastore Stable Jan 30, 2015
@yoshi-automation yoshi-automation added triage me I really want to be triaged. 🚨 This issue needs some love. labels Apr 6, 2020
atulep pushed a commit that referenced this issue Apr 3, 2023
Source-Link: googleapis/synthtool@d2871d9
Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:b2dc5f80edcf5d4486c39068c9fa11f7f851d9568eea4dcba130f994ea9b5e97

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
atulep pushed a commit that referenced this issue Apr 6, 2023
Source-Link: googleapis/synthtool@d2871d9
Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:b2dc5f80edcf5d4486c39068c9fa11f7f851d9568eea4dcba130f994ea9b5e97

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
atulep pushed a commit that referenced this issue Apr 6, 2023
Source-Link: googleapis/synthtool@d2871d9
Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:b2dc5f80edcf5d4486c39068c9fa11f7f851d9568eea4dcba130f994ea9b5e97

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
atulep pushed a commit that referenced this issue Apr 18, 2023
Source-Link: googleapis/synthtool@d2871d9
Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:b2dc5f80edcf5d4486c39068c9fa11f7f851d9568eea4dcba130f994ea9b5e97

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
parthea pushed a commit that referenced this issue Jun 4, 2023
…ation, and ListEvaluations v1beta3 APIs (#412)

* feat: added TrainProcessorVersion, EvaluateProcessorVersion, GetEvaluation, and ListEvaluations v1beta3 APIs
* feat: added evaluation.proto
* feat: added document_schema field in ProcessorVersion processor.proto
* feat: added image_quality_scores field in Document.Page in document.proto
* feat: added font_family field in Document.Style in document.proto

PiperOrigin-RevId: 488417413

Source-Link: googleapis/googleapis@6b780a3

Source-Link: googleapis/googleapis-gen@99c8d66
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiOTljOGQ2NmExZjcyN2FlM2NiNjY5NzgzMjY5MGRiYWFhMzE4Y2Q4NSJ9

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

Fixes #410

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
Co-authored-by: Holt Skinner <[email protected]>
parthea added a commit that referenced this issue Jun 4, 2023
* chore(deps): update all dependencies

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

* revert

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
Co-authored-by: Anthonios Partheniou <[email protected]>
parthea pushed a commit that referenced this issue Aug 15, 2023
* chore: update region tag for webhook validate form parameter snippet

* update snippet and test for consistency with NodeJS implementation

* linting
vchudnov-g pushed a commit that referenced this issue Sep 20, 2023
parthea pushed a commit that referenced this issue Sep 22, 2023
Source-Link: googleapis/synthtool@6ed3a83
Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:3abfa0f1886adaf0b83f07cb117b24a639ea1cb9cffe56d43280b977033563eb

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
parthea pushed a commit that referenced this issue Sep 22, 2023
Source-Link: googleapis/synthtool@f15cc72
Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:bc5eed3804aec2f05fad42aacf973821d9500c174015341f721a984a0825b6fd
parthea pushed a commit that referenced this issue Oct 21, 2023
Source-Link: https://togithub.com/googleapis/synthtool/commit/d0f51a0c2a9a6bcca86911eabea9e484baadf64b
Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:240b5bcc2bafd450912d2da2be15e62bc6de2cf839823ae4bf94d4f392b451dc
parthea pushed a commit that referenced this issue Oct 21, 2023
Source-Link: https://togithub.com/googleapis/synthtool/commit/352b9d4c068ce7c05908172af128b294073bf53c
Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:3e3800bb100af5d7f9e810d48212b37812c1856d20ffeafb99ebe66461b61fc7
parthea pushed a commit that referenced this issue Oct 21, 2023
Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
parthea pushed a commit that referenced this issue Oct 22, 2023
Source-Link: googleapis/synthtool@d2871d9
Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:b2dc5f80edcf5d4486c39068c9fa11f7f851d9568eea4dcba130f994ea9b5e97

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: datastore Issues related to the Datastore API. 🚨 This issue needs some love. triage me I really want to be triaged.
Projects
None yet
Development

No branches or pull requests

6 participants