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

Should datastore Key's be immutable? #3

Closed
jgeewax opened this issue Jan 29, 2014 · 4 comments
Closed

Should datastore Key's be immutable? #3

jgeewax opened this issue Jan 29, 2014 · 4 comments
Assignees
Labels
api: datastore Issues related to the Datastore API. type: question Request for information or clarification. Not an issue.

Comments

@jgeewax
Copy link
Contributor

jgeewax commented Jan 29, 2014

This seems like a pain in the ass to deal with if they are:

entity = dataset.entity('Person')
entity.key(entity.key().name('name'))

versus

entity = dataset.entity('Person')
entity.key().name('name')

What do we really get by making a Key immutable?

A Query being immutable makes great sense - chaining things together is easy and you can "fork" a query into several different ones. But it's unlikely we'll need to fork a key...

@jgeewax
Copy link
Contributor Author

jgeewax commented Jan 29, 2014

Good thought from @proppy: Maybe we should make the Key class a subclass of tuple or list ...

@proppy
Copy link
Contributor

proppy commented Jan 30, 2014

I drafted some ideas in this gist:
https://gist.github.com/proppy/8718248

@dhermes
Copy link
Contributor

dhermes commented Dec 19, 2014

I am working on this per the discussion in:
https://docs.google.com/document/d/1xKw8Tz6lfN5uOcv0my4uUgFSeDoRzwCLho2UGlBpqDU/edit

@dhermes
Copy link
Contributor

dhermes commented Dec 22, 2014

Closing this to consolidate the work in #451.

The answer to the question is "Yes, keys should be immutable."

@dhermes dhermes closed this as completed Dec 22, 2014
@jgeewax jgeewax modified the milestones: M1: core, datastore & storage, Datastore Stable Jan 30, 2015
tseaver pushed a commit that referenced this issue Jul 14, 2016
This was referenced Aug 3, 2016
jonathan1920 pushed a commit to jonathan1920/google-cloud-python that referenced this issue Jul 3, 2019
jkwlui added a commit that referenced this issue Nov 20, 2019
jkwlui added a commit that referenced this issue Dec 19, 2019
maintain compatibility with defaultdict

remove in place

raise KeyError on delete

update deprecation for dict-key access and factory  methods

clean up

maintain compatibility - removing duplicate in __setitems__

check for conditions for dict access

remove empty binding

fix test accessing private var _bindings

fix(tests): change version to make existing tests pass

tests: add tests for getitem, delitem, setitem on v3 and conditions

test policy.bindings property

fixlint

black

sort bindings by role when converting to api repr

add deprecation warning for iam factory methods

update deprecation message for role methods

make Policy#bindings.members a set

update policy docs

fix docs

make docs better

fix: Bigtable policy class to use Policy.bindings

add from_pb with conditions test

add to_pb condition test

blacken

fix policy __delitem__

add docs on dict access

do not modify binding in to_apr_repr
jkwlui added a commit that referenced this issue Jan 13, 2020
* iam proposal #3

maintain compatibility with defaultdict

remove in place

raise KeyError on delete

update deprecation for dict-key access and factory  methods

clean up

maintain compatibility - removing duplicate in __setitems__

check for conditions for dict access

remove empty binding

fix test accessing private var _bindings

fix(tests): change version to make existing tests pass

tests: add tests for getitem, delitem, setitem on v3 and conditions

test policy.bindings property

fixlint

black

sort bindings by role when converting to api repr

add deprecation warning for iam factory methods

update deprecation message for role methods

make Policy#bindings.members a set

update policy docs

fix docs

make docs better

fix: Bigtable policy class to use Policy.bindings

add from_pb with conditions test

add to_pb condition test

blacken

fix policy __delitem__

add docs on dict access

do not modify binding in to_apr_repr

* feat(storage): support requested_policy_version for get_iam_policy

* add system-test

* add ref doc sample to get_iam_policy

* add requested_policy_version to blob

* fix tests

* nit: typo

* blacken

* fix docs build

* format docs

* remove unused variables
parthea pushed a commit that referenced this issue Jun 4, 2023
parthea pushed a commit that referenced this issue Jun 4, 2023
parthea pushed a commit that referenced this issue Jun 4, 2023
This PR was generated using Autosynth. 🌈

Synth log will be available here:
https://source.cloud.google.com/results/invocations/6490b6f9-79ee-41b3-8813-ec1cd161dafb/targets

- [ ] To automatically regenerate this PR, check this box.

Source-Link: googleapis/synthtool@778d8be
Source-Link: googleapis/synthtool@573f765
Source-Link: googleapis/synthtool@ba960d7
parthea pushed a commit that referenced this issue Jun 4, 2023
* fix: fix link to client library documentation
* fix: pin sphinx<3.0.0

Co-authored-by: Dan O'Meara <omeara.dan@gmail.com>
parthea pushed a commit that referenced this issue Jun 4, 2023
parthea pushed a commit that referenced this issue Jun 4, 2023
* [CHANGE ME] Re-generated  to pick up changes in the API or client library generator.

* chore: regen

* chore: lower cov_level

Co-authored-by: Bu Sun Kim <busunkim@google.com>
parthea pushed a commit that referenced this issue Jun 4, 2023
🤖 I have created a release \*beep\* \*boop\*
---
## 0.1.0 (2021-03-15)


### Features

* generate v1beta2 ([87afc6d](https://www.github.com/googleapis/python-artifact-registry/commit/87afc6ddd4966e4c9acb0a88c556cbcd2fb6b566))
---


This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
parthea pushed a commit that referenced this issue Jun 4, 2023
* updated CHANGELOG.md [ci skip]

* updated setup.cfg [ci skip]

* updated setup.py [ci skip]

Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
parthea pushed a commit that referenced this issue Jun 4, 2023
🤖 I have created a release \*beep\* \*boop\* 
---
## 0.1.0 (2020-10-02)


### Features

* generate v1beta1 ([9cd5bfa](https://www.github.com/googleapis/python-security-private-ca/commit/9cd5bfaee208396ca5b27590bf09c05ad372d953))
---


This PR was generated with [Release Please](https://github.com/googleapis/release-please).
parthea pushed a commit that referenced this issue Jun 4, 2023
parthea pushed a commit that referenced this issue Jun 4, 2023
* updated CHANGELOG.md [ci skip]

* updated setup.py [ci skip]
parthea pushed a commit that referenced this issue Jun 4, 2023
parthea added a commit that referenced this issue Jun 5, 2023
* chore: use a valid post processor image

* 🦉 Updates from OwlBot

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
parthea pushed a commit that referenced this issue Jul 6, 2023
🤖 I have created a release \*beep\* \*boop\* 
---
## 0.1.0 (2020-09-24)


### Features

* add workflows v1beta ([8ec2882](https://www.github.com/googleapis/python-workflows/commit/8ec28824c2b3d7ff7dab1b14c22cca0ab7da0370))
---


This PR was generated with [Release Please](https://github.com/googleapis/release-please).
parthea pushed a commit that referenced this issue Aug 15, 2023
* fix: correct python namespace for migration API Committer: @shollyman

PiperOrigin-RevId: 399757729

Source-Link: googleapis/googleapis@2fa1722

Source-Link: googleapis/googleapis-gen@f02a4ea
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiZjAyYTRlYTRlMWE2NmY1MDUyYTNhNDY1NGJiYTBjMDAwMzUxMTgwNCJ9

* 🦉 Updates from OwlBot

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

* remove references to google/cloud/bigquery/migration

* bigquery is not a namespace package

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
Co-authored-by: Tim Swast <swast@google.com>
parthea pushed a commit that referenced this issue Aug 15, 2023
* updated CHANGELOG.md [ci skip]

* updated setup.py [ci skip]
parthea added a commit that referenced this issue Sep 14, 2023
* chore(main): release 0.1.0

* chore: fix typo

Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
Co-authored-by: Anthonios Partheniou <partheniou@google.com>
parthea pushed a commit that referenced this issue Sep 20, 2023
Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
parthea pushed a commit that referenced this issue Sep 20, 2023
* chore: update copyright year to 2022

PiperOrigin-RevId: 431037888

Source-Link: googleapis/googleapis@b3397f5

Source-Link: googleapis/googleapis-gen@510b54e
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNTEwYjU0ZTFjZGVmZDUzMTczOTg0ZGYxNjY0NTA4MTMwOGZlODk3ZSJ9

* 🦉 Updates from OwlBot post-processor

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

* 🦉 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 Sep 22, 2023
* updated CHANGELOG.md [ci skip]

* updated setup.py [ci skip]

Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
parthea added a commit that referenced this issue Sep 22, 2023
* chore: update to gapic-generator-python 1.5.0

feat: add support for `google.cloud.<api>.__version__`
PiperOrigin-RevId: 484665853

Source-Link: googleapis/googleapis@8eb249a

Source-Link: googleapis/googleapis-gen@c8aa327
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYzhhYTMyN2I1ZjQ3ODg2NWZjM2ZkOTFlM2MyNzY4ZTU0ZTI2YWQ0NCJ9

* 🦉 Updates from OwlBot post-processor

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

* add .release-please-manifest.json with correct version

* chore: Update to gapic-generator-python 1.6.0

feat(python): Add typing to proto.Message based class attributes

feat(python): Snippetgen handling of repeated enum field

PiperOrigin-RevId: 487326846

Source-Link: googleapis/googleapis@da380c7

Source-Link: googleapis/googleapis-gen@61ef576
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNjFlZjU3NjJlZTY3MzFhMGNiYmZlYTIyZmQwZWVjZWU1MWFiMWM4ZSJ9

* 🦉 Updates from OwlBot post-processor

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

* feat: new APIs added to reflect updates to the filestore service

- Add ENTERPRISE Tier
- Add snapshot APIs: RevertInstance, ListSnapshots, CreateSnapshot, DeleteSnapshot, UpdateSnapshot
- Add multi-share APIs: ListShares, GetShare, CreateShare, DeleteShare, UpdateShare
- Add ConnectMode to NetworkConfig (for Private Service Access support)
- New status codes (SUSPENDED/SUSPENDING, REVERTING/RESUMING)
- Add SuspensionReason (for KMS related suspension)
- Add new fields to Instance information: max_capacity_gb, capacity_step_size_gb, max_share_count, capacity_gb, multi_share_enabled

PiperOrigin-RevId: 487492758

Source-Link: googleapis/googleapis@5be5981

Source-Link: googleapis/googleapis-gen@ab0e217
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYWIwZTIxN2Y1NjBjYzJjMWFmYzExNDQxYzJlYWI2YjY5NTBlZmQyYiJ9

* 🦉 Updates from OwlBot post-processor

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

* chore: Update gapic-generator-python to v1.6.1

PiperOrigin-RevId: 488036204

Source-Link: googleapis/googleapis@08f275f

Source-Link: googleapis/googleapis-gen@555c094
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNTU1YzA5NDVlNjA2NDllMzg3MzlhZTY0YmM0NTcxOWNkZjcyMTc4ZiJ9

* 🦉 Updates from OwlBot post-processor

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

* add gapic_version.py

* regenerate client

* lint

* 🦉 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>
Co-authored-by: Anthonios Partheniou <partheniou@google.com>
parthea pushed a commit that referenced this issue Oct 21, 2023
Source-Link: googleapis/synthtool@26558ba
Post-Processor: gcr.io/repo-automation-bots/owlbot-python:latest@sha256:99d90d097e4a4710cc8658ee0b5b963f4426d0e424819787c3ac1405c9a26719
parthea pushed a commit that referenced this issue Oct 21, 2023
Closes #5

- [ ] Regenerate this pull request now.

PiperOrigin-RevId: 399773015

Source-Link: googleapis/googleapis@410c184

Source-Link: googleapis/googleapis-gen@290e883
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMjkwZTg4MzU0NWUzYWM5ZmYyYmQwMGNkMGRhY2IyOGYxYjhjYTk0NSJ9

chore(fix): improper types in pagers generation
chore(deps): add dependency google-cloud-common
parthea pushed a commit that referenced this issue Oct 21, 2023
* changes without context

        autosynth cannot find the source of changes triggered by earlier changes in this
        repository, or by version upgrades to tools such as linters.

* chore: add missing quotation mark

Source-Author: Bu Sun Kim <8822365+busunkim96@users.noreply.github.com>
Source-Date: Mon Jan 11 09:43:06 2021 -0700
Source-Repo: googleapis/synthtool
Source-Sha: 16ec872dd898d7de6e1822badfac32484b5d9031
Source-Link: googleapis/synthtool@16ec872

* build(python): make `NOX_SESSION` optional

I added this accidentally in #889. `NOX_SESSION` should be passed down if it is set but not marked required.

Source-Author: Bu Sun Kim <8822365+busunkim96@users.noreply.github.com>
Source-Date: Tue Jan 19 09:38:04 2021 -0700
Source-Repo: googleapis/synthtool
Source-Sha: ba960d730416fe05c50547e975ce79fcee52c671
Source-Link: googleapis/synthtool@ba960d7

* chore: Add header checker config to python library synth

Now that we have it working in [python-docs-samples](https://github.com/GoogleCloudPlatform/python-docs-samples/blob/master/.github/header-checker-lint.yml) we should consider adding it to the 🐍 libraries :)

Source-Author: Leah E. Cole <6719667+leahecole@users.noreply.github.com>
Source-Date: Mon Jan 25 13:24:08 2021 -0800
Source-Repo: googleapis/synthtool
Source-Sha: 573f7655311b553a937f9123bee17bf78497db95
Source-Link: googleapis/synthtool@573f765

* chore: add noxfile parameters for extra dependencies

Also, add tests for some noxfile parameters for assurance that the
template generates valid Python.

Co-authored-by: Jeffrey Rennie <rennie@google.com>

Source-Author: Tim Swast <swast@google.com>
Source-Date: Tue Jan 26 12:26:57 2021 -0600
Source-Repo: googleapis/synthtool
Source-Sha: 778d8beae28d6d87eb01fdc839a4b4d966ed2ebe
Source-Link: googleapis/synthtool@778d8be

* build: migrate to flakybot

Source-Author: Justin Beckwith <justin.beckwith@gmail.com>
Source-Date: Thu Jan 28 22:22:38 2021 -0800
Source-Repo: googleapis/synthtool
Source-Sha: d1bb9173100f62c0cfc8f3138b62241e7f47ca6a
Source-Link: googleapis/synthtool@d1bb917
parthea added a commit that referenced this issue Oct 22, 2023
* [CHANGE ME] Re-generated  to pick up changes in the API or client library generator.

* chore: regen

* chore: remove unused libcst dep

Co-authored-by: Bu Sun Kim <8822365+busunkim96@users.noreply.github.com>
Co-authored-by: Anthonios Partheniou <partheniou@google.com>
Co-authored-by: Bu Sun Kim <busunkim@google.com>
parthea pushed a commit that referenced this issue Oct 22, 2023
* updated CHANGELOG.md [ci skip]

* updated setup.py [ci skip]
parthea added a commit that referenced this issue Oct 22, 2023
* chore: use latest post processor image

* 🦉 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>
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