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

DISCUSSION: Should dataset ID be set on datastore key? #293

Closed
dhermes opened this issue Oct 24, 2014 · 6 comments · Fixed by #297
Closed

DISCUSSION: Should dataset ID be set on datastore key? #293

dhermes opened this issue Oct 24, 2014 · 6 comments · Fixed by #297
Assignees
Labels
api: datastore Issues related to the Datastore API. type: question Request for information or clarification. Not an issue.

Comments

@dhermes
Copy link
Contributor

dhermes commented Oct 24, 2014

This question came up in the review in #282 while trying to define the "correct" behavior of datastore.Key.__eq__.

The only remaining use of Key._dataset_id is in to_protobuf but #121 seems to indicate that the dataset ID is not needed on a Key.

ISTM we should just remove _dataset_id from the Key class, even though it is returned in the protobuf after an entity is stored/retrieved. @pcostell WDYT?

@dhermes dhermes added type: question Request for information or clarification. Not an issue. api: datastore Issues related to the Datastore API. labels Oct 24, 2014
@pcostell
Copy link
Contributor

One issue is that keys may point to other datasets so you can loose that information. So you may want to leave the dataset in there with whatever is populated from the server. I know this complicates equality checks, we plan to fix this in a future version of the API by having a more consistent dataset naming policy.

@dhermes
Copy link
Contributor Author

dhermes commented Oct 24, 2014

I can't imagine a situation where someone would have a Key object with a dataset ID and have no other way of determining the dataset.

Are there typical cases where one codebase would even interact with multiple datasets at once? (I suppose a developer service could do this, e.g. an analytics tool, but I'd expect such an application to keep datasets carefully distinguished.)

@pcostell
Copy link
Contributor

There are very few who currently do so in App Engine, but my guess too is
the analytics sort of app.

I guess I was thinking of something where the analytic app stores in its
datastore an Entity with a key property for one of its customers datasets.
When it gets that entity, it will have a Key property with a dataset that
is different than the dataset that it is stored in. If you drop the
dataset_id completely, the analytic app would not know which dataset the
key corresponded to.

Of course you could just mark it as a know limitation until a future
datastore API version fixes this. If a developer wants to do this now they
can store the external dataset as a separate string property.

On Fri Oct 24 2014 at 3:29:31 PM Danny Hermes [email protected]
wrote:

I can't imagine a situation where someone would have a Key object with a
dataset ID and have no other way of determining the dataset.

Are there typical cases where one codebase would even interact with
multiple datasets at once? (I suppose a developer service could do this,
e.g. an analytics tool, but I'd expect such an application to keep datasets
carefully distinguished.)


Reply to this email directly or view it on GitHub
#293 (comment)
.

@dhermes
Copy link
Contributor Author

dhermes commented Oct 24, 2014

Indeed. And I'd imagine the service would be doing reads only.

How does this sound as a resolution of this issue / discussion?
We make it very clear in the docstring when and how the _dataset_id will be set on a Key.

@jgeewax
Copy link
Contributor

jgeewax commented Oct 25, 2014

Sounds like we will keep the dataset_id property on a Key?

Can you be more specific with an example of what this decision looks like? I'm just having trouble wrapping my head around the solution proposed...

@dhermes
Copy link
Contributor Author

dhermes commented Oct 25, 2014

@jgeewax the solution is to leave the code as-is, just do a better job setting the expectation for the code's behavior.

tseaver added a commit that referenced this issue Oct 28, 2014
…ameter

Address #293:  document that app code should not pass 'dataset_id' to 'Key.__init__'.
@jgeewax jgeewax modified the milestone: Datastore Stable Jan 30, 2015
urshala pushed a commit to urshala/google-cloud-python that referenced this issue Jan 17, 2020
Now get_drives accepts limit, batch order_by and query parameters
atulep pushed a commit that referenced this issue Apr 6, 2023
Source-Link: googleapis/synthtool@0941ef3
Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:2f90537dd7df70f6b663cd654b1fa5dee483cf6a4edcfd46072b2775be8a23ec

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@0941ef3
Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:2f90537dd7df70f6b663cd654b1fa5dee483cf6a4edcfd46072b2775be8a23ec

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@0941ef3
Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:2f90537dd7df70f6b663cd654b1fa5dee483cf6a4edcfd46072b2775be8a23ec

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

* fix: Add service_yaml_parameters to py_gapic_library BUILD.bazel targets

PiperOrigin-RevId: 510187992

Source-Link: googleapis/googleapis@5edc235

Source-Link: googleapis/googleapis-gen@b0bedb7
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYjBiZWRiNzJlNDc2NWEzZTBiNjc0YTI4YzUwZWEwZjlhOWIyNmE4OSJ9

* 🦉 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>
parthea pushed a commit that referenced this issue Jun 4, 2023
Source-Link: googleapis/synthtool@703554a
Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:94961fdc5c9ca6d13530a6a414a49d2f607203168215d074cdb0a1df9ec31c0b
parthea pushed a commit that referenced this issue Jun 4, 2023
Source-Link: googleapis/synthtool@56da63e
Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:993a058718e84a82fda04c3177e58f0a43281a996c7c395e0a56ccc4d6d210d7
parthea pushed a commit that referenced this issue Jun 4, 2023
…cp/templates/python_library/.kokoro (#293)

Source-Link: googleapis/synthtool@b4fe62e
Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:3bf87e47c2173d7eed42714589dc4da2c07c3268610f1e47f8e1a30decbfc7f1

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
parthea added a commit that referenced this issue Jun 4, 2023
fix(deps): require proto-plus>=1.15.0
parthea added a commit that referenced this issue Jul 6, 2023
Source-Link: googleapis/synthtool@eb78c98
Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:8a5d3f6a2e43ed8293f34e06a2f56931d1e88a2694c3bb11b15df4eb256ad163

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: use gapic-generator-python 0.65.1

PiperOrigin-RevId: 441524537

Source-Link: googleapis/googleapis@2a27391

Source-Link: googleapis/googleapis-gen@ab6756a
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYWI2NzU2YTQ4Yzg5YjViY2I5ZmI3MzQ0M2NiOGU1NWQ1NzRmNDY0MyJ9

* 🦉 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>
parthea pushed a commit that referenced this issue Aug 15, 2023
Source-Link: https://togithub.com/googleapis/synthtool/commit/0ddbff8012e47cde4462fe3f9feab01fbc4cdfd6
Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:bced5ca77c4dda0fd2f5d845d4035fc3c5d3d6b81f245246a36aee114970082b
parthea added a commit that referenced this issue Sep 20, 2023
* fix: fix BQ Dataset creation.

* fix tests

* remove setup tests

Co-authored-by: Anthonios Partheniou <[email protected]>
vchudnov-g pushed a commit that referenced this issue Sep 20, 2023
Add packaging requirement. packaging.version
              is used for a version comparison in transports/base.py and is needed after the upgrade to gapic-generator-python 0.46.3
parthea pushed a commit that referenced this issue Sep 22, 2023
…p/templates/python_library/.kokoro (#293)

Source-Link: https://togithub.com/googleapis/synthtool/commit/bb171351c3946d3c3c32e60f5f18cee8c464ec51
Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:f62c53736eccb0c4934a3ea9316e0d57696bb49c1a7c86c726e9bb8a2f87dadf
parthea pushed a commit that referenced this issue Sep 22, 2023
Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
parthea pushed a commit that referenced this issue Sep 22, 2023
- [ ] Regenerate this pull request now.

PiperOrigin-RevId: 472772457

Source-Link: googleapis/googleapis@855b74d

Source-Link: googleapis/googleapis-gen@b64b1e7
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYjY0YjFlN2RhM2UxMzhmMTVjYTM2MTU1MmVmMDU0NWU1NDg5MWI0ZiJ9
parthea pushed a commit that referenced this issue Sep 22, 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 Sep 22, 2023
Source-Link: googleapis/synthtool@69fabae
Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:562802bfac02e012a6ac34eda282f81d06e77326b82a32d7bbb1369ff552b387
parthea pushed a commit that referenced this issue Sep 22, 2023
)

Source-Link: googleapis/synthtool@c1dd87e
Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:2d13c2172a5d6129c861edaa48b60ead15aeaf58aa75e02d870c4cbdfa63aaba

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
parthea pushed a commit that referenced this issue Oct 21, 2023
* Add export to BigQuery

* Add comments to variables

* fix: fix lint

* fix: fix the test

* feat: add relationship samples

* fix: fix build errors in main

* fix: fix feed tests
parthea pushed a commit that referenced this issue Oct 21, 2023
parthea added a commit that referenced this issue Oct 21, 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: Maciej Strzelczyk <[email protected]>
Co-authored-by: Anthonios Partheniou <[email protected]>
parthea pushed a commit that referenced this issue Oct 21, 2023
* chore(deps): update all dependencies

* 🦉 Updates from OwlBot

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>
parthea pushed a commit that referenced this issue Oct 21, 2023
build: switch to release-please for tagging
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 added a commit that referenced this issue Oct 21, 2023
added support for python

Co-authored-by: Anthonios Partheniou <[email protected]>
Co-authored-by: Karl Weinmeister <[email protected]>
parthea pushed a commit that referenced this issue Oct 22, 2023
Source-Link: googleapis/synthtool@0941ef3
Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:2f90537dd7df70f6b663cd654b1fa5dee483cf6a4edcfd46072b2775be8a23ec

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
parthea added a commit that referenced this issue Oct 22, 2023
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. type: question Request for information or clarification. Not an issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants