You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Problem handling local structured property kind without keys #627
According to: https://cloud.google.com/appengine/docs/python/ndb/properties#structured
Local structured properties do not require keys and AppEngine appears to be fine with this.
Unfortunately, the gcloud-python library expects keys for every entity, even if they're local structured ones.
My work around is to update my entities in AppEngine to provide dummy keys, however, it would be nice if the library supported it natively.
gcloud/datastore/helpers.pyc in entity_from_protobuf(pb)
46 :returns: The entity derived from the protobuf.
47 """
---> 48 key = key_from_protobuf(pb.key)
49 entity_props = {}
50 exclude_from_indexes = []
gcloud/datastore/helpers.pyc in key_from_protobuf(pb)
103 namespace = pb.partition_id.namespace
104
--> 105 return Key(*path_args, namespace=namespace, dataset_id=dataset_id)
gcloud/datastore/key.pyc in __init__(self, *path_args, **kwargs)
74 # _flat_path, _parent, _namespace and _dataset_id must be set before
75 # _combine_args() is called.
---> 76 self._path = self._combine_args()
gcloud/datastore/key.pyc in _combine_args(self)
131 :raises: :class:`ValueError` if the parent key is not complete.
132 """
--> 133 child_path = self._parse_path(self._flat_path)
gcloud/datastore/key.pyc in _parse_path(path_args)
92 """
93 if len(path_args) == 0:
---> 94 raise ValueError('Key path must not be empty.')
ValueError: Key path must not be empty.
Thanks for the really quick response Danny!
I was very glad I found this library, I was in the process of porting GAE's ndb library to provide a a cleaner ORM layer to Google datastore when I stumbled upon your project on an SO response. I seriously wish I'd found it sooner, keep up the great work!
Would be great if that port happens. While the async functionality on ndb is great and I use it extensively, I wouldn't even mind having a version that didn't support async initially. Simply having some OO interface to entity definitions would be a big win.
Unfortunately, discovering this library is a bit of an SEO challenge.
I see that it comes up first on a query for "gcloud datastore", however, I get the impression 'Google datastore' and 'Google cloud datastore' would be a more popular search term for the service and the Google docs on the service itself dominate search results for for anything with those combinations (understandably).
I wonder if you can get this linked from the official Google Datastore documents. Some of the other Google services have client libraries promoted that way.
I can't imagine anyone using Google datastore outside of GAE who wouldn't be hunting for a solution like this
Once we get to a 1.0 release, we'll update the official Google Cloud Platform Python snippets, examples, and documentation to use gcloud-python code (and obviously link to it from the homepage of how to get started in Python by running pip install gcloud).
Activity
dhermes commentedon Feb 13, 2015
@twumdjin Thanks for filing! It was actually filed a few days ago as #616 and fixed in #617. You can use the newest version via
or wait for the next release.
I am considering cutting a
0.4.1release tomorrow.dhermes commentedon Feb 13, 2015
Also @twumdjin thanks for using the library and caring enough to give feedback!
twumdjin commentedon Feb 13, 2015
Thanks for the really quick response Danny!
I was very glad I found this library, I was in the process of porting GAE's ndb library to provide a a cleaner ORM layer to Google datastore when I stumbled upon your project on an SO response. I seriously wish I'd found it sooner, keep up the great work!
I'll be looking forward to the next release.
dhermes commentedon Feb 13, 2015
Thanks @twumdjin
I'd also recommend following #557. We plan on porting
ndbwholesale at some point.As an aside, what sort of posting or announcement could we have made to
ndb)ndbat some pointtwumdjin commentedon Feb 13, 2015
Would be great if that port happens. While the async functionality on ndb is great and I use it extensively, I wouldn't even mind having a version that didn't support async initially. Simply having some OO interface to entity definitions would be a big win.
Unfortunately, discovering this library is a bit of an SEO challenge.
I see that it comes up first on a query for "gcloud datastore", however, I get the impression 'Google datastore' and 'Google cloud datastore' would be a more popular search term for the service and the Google docs on the service itself dominate search results for for anything with those combinations (understandably).
I wonder if you can get this linked from the official Google Datastore documents. Some of the other Google services have client libraries promoted that way.
I can't imagine anyone using Google datastore outside of GAE who wouldn't be hunting for a solution like this
dhermes commentedon Feb 13, 2015
Thanks for the detailed feedback @twumdjin. It's really useful!
/cc @jgeewax
jgeewax commentedon Feb 13, 2015
Thanks for the feedback @twumdjin (and for the CC @dhermes) !
Once we get to a 1.0 release, we'll update the official Google Cloud Platform Python snippets, examples, and documentation to use gcloud-python code (and obviously link to it from the homepage of how to get started in Python by running
pip install gcloud).If you're interested in the "1.0" timeline, we're aiming for the Datastore, Storage, and Core "Stable" milestones to be closed out (see https://github.com/GoogleCloudPlatform/gcloud-python/milestones?direction=desc&sort=completeness&state=open).
twumdjin commentedon Feb 14, 2015
Thanks for the 0.4.1 update with the fix @dhermes!
dhermes commentedon Feb 14, 2015
Glad it helps!
feat: added support for custom content types (#627)
chore(main): release 2.11.1 (#627)
fix: fix typo attribue -> attribute (#627)
chore: use gapic generator python 1.4.1 (#627)
chore: use gapic generator python 1.4.1 (#627)
chore(python): use black==22.3.0 (#627)
chore(deps): update dependency google-cloud-bigquery to v2.14.0 (#627)
chore(deps): update dependency grpc-google-iam-v1 to v0.14.2 (#627)
feat(db_api): support JSON data type (#627)
docs: migrate code from googleapis/python-bigquery (#18303)