Skip to content

Commit 054dfb3

Browse files
committed
Fix lint errors caused by addition of (Optional).
Mostly, lines that were too long.
1 parent 991ad11 commit 054dfb3

26 files changed

Lines changed: 195 additions & 152 deletions

File tree

bigquery/google/cloud/bigquery/query.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -349,14 +349,15 @@ def fetch_data(self, max_results=None, page_token=None, start_index=None,
349349
:param max_results: (Optional) maximum number of rows to return.
350350
351351
:type page_token: str
352-
:param page_token: (Optional) token representing a cursor into the table's rows.
352+
:param page_token:
353+
(Optional) token representing a cursor into the table's rows.
353354
354355
:type start_index: int
355356
:param start_index: (Optional) zero-based index of starting row
356357
357358
:type timeout_ms: int
358-
:param timeout_ms: (Optional) timeout, in milliseconds, to wait for query to
359-
complete
359+
:param timeout_ms:
360+
(Optional) timeout, in milliseconds, to wait for query to complete
360361
361362
:type client: :class:`~google.cloud.bigquery.client.Client` or
362363
``NoneType``

core/google/cloud/connection.py

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -215,10 +215,10 @@ def _make_request(self, method, url, data=None, content_type=None,
215215
:param headers: A dictionary of HTTP headers to send with the request.
216216
217217
:type target_object: object
218-
:param target_object: (Optional) Argument to be used by library callers.
219-
This can allow custom behavior, for example, to
220-
defer an HTTP request and complete initialization
221-
of the object at a later time.
218+
:param target_object:
219+
(Optional) Argument to be used by library callers. This can allow
220+
custom behavior, for example, to defer an HTTP request and complete
221+
initialization of the object at a later time.
222222
223223
:rtype: tuple of ``response`` (a dictionary of sorts)
224224
and ``content`` (a string).
@@ -262,8 +262,9 @@ def _do_request(self, method, url, headers, data,
262262
:param data: The data to send as the body of the request.
263263
264264
:type target_object: object
265-
:param target_object: (Optional) Unused ``target_object`` here but may be used
266-
by a superclass.
265+
:param target_object:
266+
(Optional) Unused ``target_object`` here but may be used by a
267+
superclass.
267268
268269
:rtype: tuple of ``response`` (a dictionary of sorts)
269270
and ``content`` (a string).
@@ -324,10 +325,10 @@ def api_request(self, method, path, query_params=None,
324325
that cannot be done. Default is True.
325326
326327
:type _target_object: :class:`object`
327-
:param _target_object: (Optional) Protected argument to be used by library
328-
callers. This can allow custom behavior, for
329-
example, to defer an HTTP request and complete
330-
initialization of the object at a later time.
328+
:param _target_object:
329+
(Optional) Protected argument to be used by library callers. This
330+
can allow custom behavior, for example, to defer an HTTP request
331+
and complete initialization of the object at a later time.
331332
332333
:raises: Exception if the response code is not 200 OK.
333334
:rtype: dict or str

core/google/cloud/streaming/buffered_stream.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,9 @@ def read(self, size=None):
8282
"""Read bytes from the buffer.
8383
8484
:type size: int
85-
:param size: (Optional) How many bytes to read (defaults to all remaining bytes).
85+
:param size:
86+
(Optional) How many bytes to read (defaults to all remaining
87+
bytes).
8688
8789
:rtype: str
8890
:returns: The data read from the stream.

core/google/cloud/streaming/http_wrapper.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,8 @@ def _httplib2_debug_level(http_request, level, http=None):
8181
:param level: the debuglevel for logging.
8282
8383
:type http: :class:`httplib2.Http`
84-
:param http: (Optional) the instance on whose connections to set the debuglevel.
84+
:param http:
85+
(Optional) the instance on whose connections to set the debuglevel.
8586
"""
8687
if http_request.loggable_body is None:
8788
yield

core/google/cloud/streaming/stream_slice.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,9 @@ def read(self, size=None):
6666
raise :exc:`IncompleteRead`.
6767
6868
:type size: int
69-
:param size: (Optional) If provided, read no more than size bytes from the stream.
69+
:param size:
70+
(Optional) If provided, read no more than size bytes from the
71+
stream.
7072
7173
:rtype: bytes
7274
:returns: bytes read from this slice.

core/google/cloud/streaming/transfer.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -670,7 +670,8 @@ def from_file(cls, filename, mime_type=None, auto_transfer=True, **kwds):
670670
:param mime_type: MIMEtype of the file being uploaded
671671
672672
:type auto_transfer: bool
673-
:param auto_transfer: (Optional) should the transfer be started immediately
673+
:param auto_transfer:
674+
(Optional) should the transfer be started immediately
674675
675676
:type kwds: dict
676677
:param kwds: keyword arguments: passed
@@ -704,7 +705,8 @@ def from_stream(cls, stream, mime_type,
704705
:param total_size: (Optional) Size of the file being uploaded
705706
706707
:type auto_transfer: bool
707-
:param auto_transfer: (Optional) should the transfer be started immediately
708+
:param auto_transfer:
709+
(Optional) should the transfer be started immediately
708710
709711
:type kwds: dict
710712
:param kwds: keyword arguments: passed

datastore/google/cloud/datastore/query.py

Lines changed: 13 additions & 10 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
4142
:type namespace: str
42-
:param namespace: (Optional) The namespace to which to restrict results. If not
43-
passed, uses the client's value.
43+
:param namespace:
44+
(Optional) The namespace to which to restrict results. If not passed,
45+
uses the client's value.
4446
4547
:type ancestor: :class:`google.cloud.datastore.key.Key`
46-
:param ancestor: (Optional) key of the ancestor to which this query's results are
47-
restricted.
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.
@@ -328,16 +331,16 @@ def fetch(self, limit=None, offset=0, start_cursor=None, end_cursor=None,
328331
[<Entity object>]
329332
330333
:type limit: int
331-
:param limit: (Optional) An optional limit passed through to the iterator.
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.

dns/google/cloud/dns/changes.py

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -170,8 +170,9 @@ def _require_client(self, client):
170170
"""Check client or verify over-ride.
171171
172172
:type client: :class:`google.cloud.dns.client.Client`
173-
:param client: (Optional) the client to use. If not passed, falls back to the
174-
``client`` stored on the current zone.
173+
:param client:
174+
(Optional) the client to use. If not passed, falls back to the
175+
``client`` stored on the current zone.
175176
176177
:rtype: :class:`google.cloud.dns.client.Client`
177178
:returns: The client passed in or the currently bound client.
@@ -208,8 +209,9 @@ def create(self, client=None):
208209
https://cloud.google.com/dns/api/v1/changes/create
209210
210211
:type client: :class:`google.cloud.dns.client.Client`
211-
:param client: (Optional) the client to use. If not passed, falls back to the
212-
``client`` stored on the current zone.
212+
:param client:
213+
(Optional) the client to use. If not passed, falls back to the
214+
``client`` stored on the current zone.
213215
"""
214216
if len(self.additions) == 0 and len(self.deletions) == 0:
215217
raise ValueError("No record sets added or deleted")
@@ -227,8 +229,9 @@ def exists(self, client=None):
227229
https://cloud.google.com/dns/api/v1/changes/get
228230
229231
:type client: :class:`google.cloud.dns.client.Client`
230-
:param client: (Optional) the client to use. If not passed, falls back to the
231-
``client`` stored on the current zone.
232+
:param client:
233+
(Optional) the client to use. If not passed, falls back to the
234+
``client`` stored on the current zone.
232235
233236
:rtype: bool
234237
:returns: Boolean indicating existence of the changes.
@@ -249,8 +252,9 @@ def reload(self, client=None):
249252
https://cloud.google.com/dns/api/v1/changes/get
250253
251254
:type client: :class:`google.cloud.dns.client.Client`
252-
:param client: (Optional) the client to use. If not passed, falls back to the
253-
``client`` stored on the current zone.
255+
:param client:
256+
(Optional) the client to use. If not passed, falls back to the
257+
``client`` stored on the current zone.
254258
"""
255259
client = self._require_client(client)
256260

dns/google/cloud/dns/client.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -92,12 +92,14 @@ def zone(self, name, dns_name=None, description=None):
9292
:param name: Name of the zone.
9393
9494
:type dns_name: str
95-
:param dns_name: (Optional) DNS name of the zone. If not passed, then calls
96-
to :meth:`zone.create` will fail.
95+
:param dns_name:
96+
(Optional) DNS name of the zone. If not passed, then calls to
97+
:meth:`zone.create` will fail.
9798
9899
:type description: str
99-
:param description: (Optional) the description for the zone. If not passed,
100-
defaults to the value of 'dns_name'.
100+
:param description:
101+
(Optional) the description for the zone. If not passed, defaults
102+
to the value of 'dns_name'.
101103
102104
:rtype: :class:`google.cloud.dns.zone.ManagedZone`
103105
:returns: a new ``ManagedZone`` instance.

dns/google/cloud/dns/zone.py

Lines changed: 27 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -33,16 +33,18 @@ class ManagedZone(object):
3333
:param name: the name of the zone
3434
3535
:type dns_name: str
36-
:param dns_name: (Optional) the DNS name of the zone. If not passed, then calls
37-
to :meth:`create` will fail.
36+
:param dns_name:
37+
(Optional) the DNS name of the zone. If not passed, then calls to
38+
:meth:`create` will fail.
3839
3940
:type client: :class:`google.cloud.dns.client.Client`
4041
:param client: A client which holds credentials and project configuration
4142
for the zone (which requires a project).
4243
4344
:type description: str
44-
:param description: (Optional) the description for the zone. If not passed, defaults
45-
to the value of 'dns_name'.
45+
:param description:
46+
(Optional) the description for the zone. If not passed, defaults to
47+
the value of 'dns_name'.
4648
"""
4749

4850
def __init__(self, name, dns_name=None, client=None, description=None):
@@ -203,8 +205,9 @@ def _require_client(self, client):
203205
"""Check client or verify over-ride.
204206
205207
:type client: :class:`google.cloud.dns.client.Client`
206-
:param client: (Optional) the client to use. If not passed, falls back to the
207-
``client`` stored on the current zone.
208+
:param client:
209+
(Optional) the client to use. If not passed, falls back to the
210+
``client`` stored on the current zone.
208211
209212
:rtype: :class:`google.cloud.dns.client.Client`
210213
:returns: The client passed in or the currently bound client.
@@ -251,8 +254,9 @@ def create(self, client=None):
251254
https://cloud.google.com/dns/api/v1/managedZones/create
252255
253256
:type client: :class:`google.cloud.dns.client.Client`
254-
:param client: (Optional) the client to use. If not passed, falls back to the
255-
``client`` stored on the current zone.
257+
:param client:
258+
(Optional) the client to use. If not passed, falls back to the
259+
``client`` stored on the current zone.
256260
"""
257261
client = self._require_client(client)
258262
path = '/projects/%s/managedZones' % (self.project,)
@@ -267,8 +271,9 @@ def exists(self, client=None):
267271
https://cloud.google.com/dns/api/v1/managedZones/get
268272
269273
:type client: :class:`google.cloud.dns.client.Client`
270-
:param client: (Optional) the client to use. If not passed, falls back to the
271-
``client`` stored on the current zone.
274+
:param client:
275+
(Optional) the client to use. If not passed, falls back to the
276+
``client`` stored on the current zone.
272277
273278
:rtype: bool
274279
:returns: Boolean indicating existence of the managed zone.
@@ -290,8 +295,9 @@ def reload(self, client=None):
290295
https://cloud.google.com/dns/api/v1/managedZones/get
291296
292297
:type client: :class:`google.cloud.dns.client.Client`
293-
:param client: (Optional) the client to use. If not passed, falls back to the
294-
``client`` stored on the current zone.
298+
:param client:
299+
(Optional) the client to use. If not passed, falls back to the
300+
``client`` stored on the current zone.
295301
"""
296302
client = self._require_client(client)
297303

@@ -306,8 +312,9 @@ def delete(self, client=None):
306312
https://cloud.google.com/dns/api/v1/managedZones/delete
307313
308314
:type client: :class:`google.cloud.dns.client.Client`
309-
:param client: (Optional) the client to use. If not passed, falls back to the
310-
``client`` stored on the current zone.
315+
:param client:
316+
(Optional) the client to use. If not passed, falls back to the
317+
``client`` stored on the current zone.
311318
"""
312319
client = self._require_client(client)
313320
client.connection.api_request(method='DELETE', path=self.path)
@@ -329,8 +336,9 @@ def list_resource_record_sets(self, max_results=None, page_token=None,
329336
zones.
330337
331338
:type client: :class:`google.cloud.dns.client.Client`
332-
:param client: (Optional) the client to use. If not passed, falls back to the
333-
``client`` stored on the current zone.
339+
:param client:
340+
(Optional) the client to use. If not passed, falls back to the
341+
``client`` stored on the current zone.
334342
335343
:rtype: :class:`~google.cloud.iterator.Iterator`
336344
:returns: Iterator of :class:`~.resource_record_set.ResourceRecordSet`
@@ -362,8 +370,9 @@ def list_changes(self, max_results=None, page_token=None, client=None):
362370
zones.
363371
364372
:type client: :class:`google.cloud.dns.client.Client`
365-
:param client: (Optional) the client to use. If not passed, falls back to the
366-
``client`` stored on the current zone.
373+
:param client:
374+
(Optional) the client to use. If not passed, falls back to the
375+
``client`` stored on the current zone.
367376
368377
:rtype: :class:`~google.cloud.iterator.Iterator`
369378
:returns: Iterator of :class:`~.changes.Changes`

0 commit comments

Comments
 (0)