Skip to content

Commit 4c4f891

Browse files
committed
Avoid mandating type of field names passed to 'exclude_from_indexes'.
Incorporates feedback from @dhermes.
1 parent 6b8f52a commit 4c4f891

2 files changed

Lines changed: 16 additions & 6 deletions

File tree

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: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,16 @@ class Entity(dict):
6868
>>> dict(entity)
6969
{'age': 20, 'name': 'JJ'}
7070
71+
72+
:type dataset: :class:`gcloud.datastore.dataset.Dataset`, or None
73+
:param dataset: the Dataset instance associated with this entity.
74+
75+
:type kind: str
76+
:param kind: the "kind" of the entity (see
77+
https://cloud.google.com/datastore/docs/concepts/entities#Datastore_Kinds_and_identifiers)
78+
79+
:param exclude_from_indexes: names of fields whose values are not to be
80+
indexed for this entity.
7181
"""
7282

7383
def __init__(self, dataset=None, kind=None, exclude_from_indexes=()):
@@ -132,9 +142,9 @@ def kind(self):
132142
return self._key.kind()
133143

134144
def exclude_from_indexes(self):
135-
"""Return field names which are *not* to be indexed.
145+
"""Names of fields which are *not* to be indexed for this entity.
136146
137-
:rtype: list(str)
147+
:rtype: sequence of field names
138148
"""
139149
return frozenset(self._exclude_from_indexes)
140150

0 commit comments

Comments
 (0)