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

Dataset ID aliases don't behave consistently. #59

Closed
dhermes opened this issue Dec 23, 2014 · 6 comments
Closed

Dataset ID aliases don't behave consistently. #59

dhermes opened this issue Dec 23, 2014 · 6 comments

Comments

@dhermes
Copy link

dhermes commented Dec 23, 2014

Using the "human-readable" version foo of the prefixed ID s~foo (or e~foo) is allowed in a URI but not in a request payload (and will never be returned in a response since foo gets mapped to s~foo in the response).

This inconsistency can catch user's off-guard and requires custom behavior in to_protobuf()-type methods which essentially always ignore the dataset_id on a PartitionId message and only use the dataset ID in the URI.

/cc @silvolu @tseaver


Some examples

  1. Sending a query to
https://www.googleapis.com/datastore/v1beta2/datasets/foo/runQuery

which has RunQueryRequest.partition_id.dataset_id == 'foo' in the payload results in

app s~foo cannot access app foo's data
  1. Sending a mutation (or a lookup) to one of
https://www.googleapis.com/datastore/v1beta2/datasets/foo/allocateIds
https://www.googleapis.com/datastore/v1beta2/datasets/foo/commit
https://www.googleapis.com/datastore/v1beta2/datasets/foo/lookup

which has Key.partition_id.dataset_id == 'foo' (either directly in a key
or in an Entity) in the payload results in

app s~foo cannot access app foo's data
  1. Sending a filtered or ancestor query which does not have
    RunQueryRequest.partition_id.dataset_id set in the payload but does have
    the dataset ID set in either the ancestor key
The query app is 'foo' but ancestor.key app is 'foo'.

or in the __key__ filter

__key__ filter app is foo but query app is s~foo
dhermes added a commit to dhermes/google-cloud-python that referenced this issue Dec 23, 2014
Addresses seventh part of googleapis#451.

Also requires removing the dataset_id from generated protobufs
due to googleapis/google-cloud-datastore#59. This
occurs also in __key__ filters and ancestor queries.
@eddavisson
Copy link
Contributor

Thanks for the report -- we are planning on fixing this in a future version of the API.

In the mean time, leaving PartitionId.dataset_id blank input should do the right thing in both mutations and query filters.

dhermes added a commit to dhermes/google-cloud-python that referenced this issue Dec 30, 2014
Addresses seventh part of googleapis#451.

Also requires removing the dataset_id from generated protobufs
due to googleapis/google-cloud-datastore#59. This
occurs also in __key__ filters and ancestor queries.
dhermes added a commit to dhermes/google-cloud-python that referenced this issue Dec 31, 2014
Addresses seventh part of googleapis#451.

Also requires removing the dataset_id from generated protobufs
due to googleapis/google-cloud-datastore#59. This
occurs also in __key__ filters and ancestor queries.
dhermes added a commit to dhermes/google-cloud-python that referenced this issue Dec 31, 2014
Addresses seventh part of googleapis#451.

Also requires removing the dataset_id from generated protobufs
due to googleapis/google-cloud-datastore#59. This
occurs also in __key__ filters and ancestor queries.
dhermes added a commit to dhermes/google-cloud-python that referenced this issue Dec 31, 2014
Addresses seventh part of googleapis#451.

Also requires removing the dataset_id from generated protobufs
due to googleapis/google-cloud-datastore#59. This
occurs also in __key__ filters and ancestor queries.
dhermes added a commit to dhermes/google-cloud-python that referenced this issue Dec 31, 2014
Addresses seventh part of googleapis#451.

Also requires removing the dataset_id from generated protobufs
due to googleapis/google-cloud-datastore#59. This
occurs also in __key__ filters and ancestor queries.
@dhermes
Copy link
Author

dhermes commented Mar 31, 2015

@eddavisson @pcostell Do you have an idea of when this might land?

@dhermes
Copy link
Author

dhermes commented Jun 25, 2015

@pcostell will this be addressed in v1beta3?

@eddavisson
Copy link
Contributor

Yes.

@dhermes
Copy link
Author

dhermes commented Jun 25, 2015

w00t!

@pcostell
Copy link
Contributor

pcostell commented Apr 4, 2016

Per https://cloud.google.com/datastore/release-notes, in v1beta3 it is always project_id and never includes the prefix ("s~" and friends).

@pcostell pcostell closed this as completed Apr 4, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants