-
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
dict only datastore put #410
Comments
Though convenient in some sense, I don't think a stringly typed approach is the way of the Python Jedi here.
|
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. |
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. I think a generic Entity class like gcloud-python has today, belong more to a base layer in a higher level library like NDB. |
@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! |
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>
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>
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>
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>
…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 <13262395+holtskinner@users.noreply.github.com>
* 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 <partheniou@google.com>
* chore: update region tag for webhook validate form parameter snippet * update snippet and test for consistency with NodeJS implementation * linting
Co-authored-by: Anthonios Partheniou <partheniou@google.com>
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>
Source-Link: googleapis/synthtool@f15cc72 Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:bc5eed3804aec2f05fad42aacf973821d9500c174015341f721a984a0825b6fd
Source-Link: https://github.com/googleapis/synthtool/commit/d0f51a0c2a9a6bcca86911eabea9e484baadf64b Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:240b5bcc2bafd450912d2da2be15e62bc6de2cf839823ae4bf94d4f392b451dc
Source-Link: https://github.com/googleapis/synthtool/commit/352b9d4c068ce7c05908172af128b294073bf53c Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:3e3800bb100af5d7f9e810d48212b37812c1856d20ffeafb99ebe66461b61fc7
Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
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>
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:
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!
The text was updated successfully, but these errors were encountered: