Skip to content

Commit f335a96

Browse files
authored
Merge pull request #2584 from tswast/nonetype-to-optional
Remove None & NoneType from parameter types in docstrings.
2 parents 80e7f60 + e7ab357 commit f335a96

File tree

3 files changed

+20
-17
lines changed

3 files changed

+20
-17
lines changed

packages/google-cloud-datastore/google/cloud/datastore/connection.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -569,8 +569,8 @@ def commit(self, project, request, transaction_id):
569569
:type request: :class:`._generated.datastore_pb2.CommitRequest`
570570
:param request: The protobuf with the mutations being committed.
571571
572-
:type transaction_id: str or None
573-
:param transaction_id: The transaction ID returned from
572+
:type transaction_id: str
573+
:param transaction_id: (Optional) The transaction ID returned from
574574
:meth:`begin_transaction`. Non-transactional
575575
batches must pass ``None``.
576576

packages/google-cloud-datastore/google/cloud/datastore/key.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -388,8 +388,8 @@ def _validate_project(project, parent):
388388
:type project: str
389389
:param project: A project.
390390
391-
:type parent: :class:`google.cloud.datastore.key.Key` or ``NoneType``
392-
:param parent: The parent of the key or ``None``.
391+
:type parent: :class:`google.cloud.datastore.key.Key`
392+
:param parent: (Optional) The parent of the key or ``None``.
393393
394394
:rtype: str
395395
:returns: The ``project`` passed in, or implied from the environment.

packages/google-cloud-datastore/google/cloud/datastore/query.py

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -35,16 +35,19 @@ class Query(object):
3535
:param kind: The kind to query.
3636
3737
:type project: str
38-
:param project: The project associated with the query. If not passed,
39-
uses the client's value.
38+
:param project:
39+
(Optional) The project associated with the query. If not passed, uses
40+
the client's value.
4041
41-
:type namespace: str or None
42-
:param namespace: The namespace to which to restrict results. If not
43-
passed, uses the client's value.
42+
:type namespace: str
43+
:param namespace:
44+
(Optional) The namespace to which to restrict results. If not passed,
45+
uses the client's value.
4446
45-
:type ancestor: :class:`google.cloud.datastore.key.Key` or None
46-
:param ancestor: key of the ancestor to which this query's results are
47-
restricted.
47+
:type ancestor: :class:`google.cloud.datastore.key.Key`
48+
:param ancestor:
49+
(Optional) key of the ancestor to which this query's results are
50+
restricted.
4851
4952
:type filters: sequence of (property_name, operator, value) tuples
5053
:param filters: property filters applied by this query.
@@ -327,17 +330,17 @@ def fetch(self, limit=None, offset=0, start_cursor=None, end_cursor=None,
327330
>>> list(query.fetch(1))
328331
[<Entity object>]
329332
330-
:type limit: int or None
331-
:param limit: An optional limit passed through to the iterator.
333+
:type limit: int
334+
:param limit: (Optional) limit passed through to the iterator.
332335
333336
:type offset: int
334-
:param offset: An optional offset passed through to the iterator.
337+
:param offset: (Optional) offset passed through to the iterator.
335338
336339
:type start_cursor: bytes
337-
:param start_cursor: An optional cursor passed through to the iterator.
340+
:param start_cursor: (Optional) cursor passed through to the iterator.
338341
339342
:type end_cursor: bytes
340-
:param end_cursor: An optional cursor passed through to the iterator.
343+
:param end_cursor: (Optional) cursor passed through to the iterator.
341344
342345
:type client: :class:`google.cloud.datastore.client.Client`
343346
:param client: client used to connect to datastore.

0 commit comments

Comments
 (0)