Skip to content

Commit a0a9b54

Browse files
committed
Remove None from param types and add (Optional).
This runs a script to remove None from the types for parameters, and added (Optional) to the description. Does not pass lint due to some too-long lines. I will clean those up manually. See: googleapis/google-cloud-python#2580 (review)
1 parent 2327934 commit a0a9b54

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

google/cloud/datastore/connection.py

+2-2
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

google/cloud/datastore/key.py

+2-2
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.

google/cloud/datastore/query.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,12 @@ class Query(object):
3838
:param project: The project associated with the query. If not passed,
3939
uses the client's value.
4040
41-
:type namespace: str or None
42-
:param namespace: The namespace to which to restrict results. If not
41+
:type namespace: str
42+
:param namespace: (Optional) The namespace to which to restrict results. If not
4343
passed, uses the client's value.
4444
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
45+
:type ancestor: :class:`google.cloud.datastore.key.Key`
46+
:param ancestor: (Optional) key of the ancestor to which this query's results are
4747
restricted.
4848
4949
:type filters: sequence of (property_name, operator, value) tuples
@@ -327,8 +327,8 @@ def fetch(self, limit=None, offset=0, start_cursor=None, end_cursor=None,
327327
>>> list(query.fetch(1))
328328
[<Entity object>]
329329
330-
:type limit: int or None
331-
:param limit: An optional limit passed through to the iterator.
330+
:type limit: int
331+
:param limit: (Optional) An optional limit passed through to the iterator.
332332
333333
:type offset: int
334334
:param offset: An optional offset passed through to the iterator.

0 commit comments

Comments
 (0)