8000 Address fourth part of 451: Make Key constructor easier to use by taking positional args. by dhermes · Pull Request #460 · googleapis/google-cloud-python · GitHub
[go: up one dir, main page]

Skip to content

Conversation

dhermes
Copy link
Contributor
@dhermes dhermes commented Dec 23, 2014

Make Key constructor easier to use by taking positional args.

Addresses fourth part of #451.

NOTE: This has #459 as a diffbase.

@coveralls
Copy link

Coverage Status

Coverage remained the same when pulling c17800d on dhermes:fix-451-part4 into b343acf on GoogleCloudPlatform:master.

@tseaver
Copy link
Contributor
tseaver commented Dec 30, 2014

c17800d do we need to expose flat_path as a public method (it isn't tested explicitly, for instance). It looks as though we only use it in _make_parent (where we could just use the attribute).

Other than that, LGTM.

@dhermes
Copy link
Contributor Author
8000 dhermes commented Dec 30, 2014

RE: flat_path, I initially added it because I thought we'd need it for things like

>>> partial_key = Key('Foo', 1, 'Bar')
>>> new_path = partial_key.flath_path + (1000,)
>>> entity = Entity(*new_path)

This is no longer the goal, but ISTM the contents of flat_path will be much more useful to users than the contents of path as a list of dicts.

(Through some discussions in #336 and elsewhere it seems it's best to just have Entity.__init__ take a key as a positional arg, since we made the Key constructor easier to use already.)

@coveralls
Copy link

Coverage Status

Coverage remained the same when pulling 03f5dd8 on dhermes:fix-451-part4 into 8cb41f6 on GoogleCloudPlatform:master.

@dhermes
Copy link
Contributor Author
dhermes commented Dec 30, 2014

@tseaver I added 16760fb since your review because I realized we had false positives from things like

>>> datastore.key.Key('Foo', None, dataset_id='foo')
<Key[{'kind': 'Foo'}], dataset=foo>
>>> datastore.key.Key('Foo', None, 'Bar', 10, dataset_id='foo')
<Key[{'kind': 'Foo'}, {'kind': 'Bar', 'id': 10}], dataset=foo>

@tseaver
Copy link
Contributor
tseaver commented Dec 31, 2014

Ugh, the rebase ruins the commit hash in your comment.

If you don't think we need to pull the flat_path property, go ahead and merge.

@coveralls
Copy link

Coverage Status

Coverage remained the same when pulling 676b20c on dhermes:fix-451-part4 into cfea8e9 on GoogleCloudPlatform:master.

dhermes added a commit that referenced this pull request Dec 31, 2014
Address fourth part of 451: Make Key constructor easier to use by taking positional args.
@dhermes dhermes merged commit 74e6c16 into googleapis:master Dec 31, 2014
@dhermes
Copy link
Contributor Author
dhermes commented Dec 31, 2014

@tseaver I agree having flat_path and path is confusing, I just am not sure which will be more useful going forward.

@dhermes dhermes deleted the fix-451-part4 branch December 31, 2014 21:12
@dhermes dhermes added the api: datastore Issues related to the Datastore API. label Dec 31, 2015
atulep pushed a commit that referenced this pull request Apr 6, 2023
Co-authored-by: Nitsan Shai <nshai@google.com>
atulep pushed a commit that referenced this pull request Apr 6, 2023
Co-authored-by: Nitsan Shai <nshai@google.com>
atulep pushed a commit that referenced this pull request Apr 18, 2023
Co-authored-by: Nitsan Shai <nshai@google.com>
parthea pushed a commit that referenced this pull request Jun 4, 2023
Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
parthea pushed a commit that referenced this pull request Jun 4, 2023
Source-Link: https://togithub.com/googleapis/synthtool/commit/26c7505b2f76981ec1707b851e1595c8c06e90fc
Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:f946c75373c2b0040e8e318c5e85d0cf46bc6e61d0a01f3ef94d8de974ac6790
parthea pushed a commit that referenced this pull request Aug 15, 2023
* docs: clarified gcs_bucket field of the SecuritySettings message

PiperOrigin-RevId: 477778532

Source-Link: googleapis/googleapis@22d2bda

Source-Link: googleapis/googleapis-gen@821f121
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiODIxZjEyMWYwMWMxNTBlNGRiZDBiZjlhNzkyYmMwNWMyY2VlYzFkMiJ9

* 🦉 Updates from OwlBot post-processor

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

* docs: clarified gcs_bucket field of the SecuritySettings message

PiperOrigin-RevId: 478035442

Source-Link: googleapis/googleapis@8cb255f

Source-Link: googleapis/googleapis-gen@461eeeb
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNDYxZWVlYjc3MGMwMzk3YjVlZjgzOTJkMjQyOTk1M2YxMzkzZmY2NCJ9

* 🦉 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>
vchudnov-g pushed a commit that referenced this pull request Sep 20, 2023
Source-Link: googleapis/synthtool@69fda12
Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:ae600f36b6bc972b368367b6f83a1d91ec2c82a4a116b383d67d547c56fe6de3

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
Co-authored-by: Anthonios Partheniou <partheniou@google.com>
parthea added a commit that referenced this pull request Sep 22, 2023
Co-authored-by: Anthonios Partheniou <partheniou@google.com>
parthea pushed a commit that referenced this pull request Sep 22, 2023
Source-Link: https://togithub.com/googleapis/synthtool/commit/25083af347468dd5f90f69627420f7d452b6c50e
Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:e6cbd61f1838d9ff6a31436dfc13717f372a7482a82fc1863ca954ec47bff8c8
parthea pushed a commit that referenced this pull request Oct 21, 2023
Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
parthea added a commit that referenced this pull request Oct 21, 2023
* chore(bazel): update protobuf to v3.21.3

chore(bazel): update gax-java to 2.18.4

PiperOrigin-RevId: 463115700

Source-Link: googleapis/googleapis@52130a9

Source-Link: googleapis/googleapis-gen@6a4d9d9
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNmE0ZDlkOWJiM2FmYjIwYjBmNWZhNGY1ZDlmNjc0MGIxZDBlYjE5YSJ9

* 🦉 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 pull request Oct 21, 2023
Source-Link: googleapis/synthtool@7197a00
Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:c43f1d918bcf817d337aa29ff833439494a158a0831508fda4ec75dc4c0d0320

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
parthea pushed a commit that referenced this pull request Oct 22, 2023
Co-authored-by: Nitsan Shai <nshai@google.com>
parthea pushed a commit that referenced this pull request Sep 18, 2025
Source-Link: googleapis/synthtool@52aef91
Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:36a95b8f494e4674dc9eee9af98961293b51b86b3649942aac800ae6c1f796d4

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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

0