Skip to content

Commit 5762cbf

Browse files
committed
Avoid mandating type of field names passed to 'exclude_from_indexes'.
Incorporates feedback from @dhermes.
1 parent 41a0412 commit 5762cbf

File tree

2 files changed

+15
-6
lines changed

2 files changed

+15
-6
lines changed

gcloud/datastore/dataset.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,11 +82,11 @@ def entity(self, kind, exclude_from_indexes=()):
8282
"""Create an entity bound to this dataset.
8383
8484
:type kind: string
85-
:param kind: the "kind" of the new entity.
85+
:param kind: the "kind" of the new entity (see
86+
https://cloud.google.com/datastore/docs/concepts/entities#Datastore_Kinds_and_identifiers)
8687
87-
:type exclude_from_indexes: sequence of str
88-
:param exclude_from_indexes: Names of properties *not* to be indexed
89-
for the entity.
88+
:param exclude_from_indexes: names of fields whose values are not to
89+
be indexed.
9090
9191
:rtype: :class:`gcloud.datastore.entity.Entity`
9292
:returns: a new Entity instance, bound to this dataset.

gcloud/datastore/entity.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,15 @@ class Entity(dict):
7878
Python3), will be saved using the 'blob_value' field, without
7979
any decoding / encoding step.
8080
81+
:type dataset: :class:`gcloud.datastore.dataset.Dataset`, or None
82+
:param dataset: the Dataset instance associated with this entity.
83+
84+
:type kind: str
85+
:param kind: the "kind" of the entity (see
86+
https://cloud.google.com/datastore/docs/concepts/entities#Datastore_Kinds_and_identifiers)
87+
88+
:param exclude_from_indexes: names of fields whose values are not to be
89+
indexed for this entity.
8190
"""
8291

8392
def __init__(self, dataset=None, kind=None, exclude_from_indexes=()):
@@ -142,9 +151,9 @@ def kind(self):
142151
return self._key.kind()
143152

144153
def exclude_from_indexes(self):
145-
"""Return field names which are *not* to be indexed.
154+
"""Names of fields which are *not* to be indexed for this entity.
146155
147-
:rtype: list(str)
156+
:rtype: sequence of field names
148157
"""
149158
return frozenset(self._exclude_from_indexes)
150159

0 commit comments

Comments
 (0)