Skip to content

Commit a8e0973

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 fcb9fa2 commit a8e0973

File tree

3 files changed

+48
-47
lines changed

3 files changed

+48
-47
lines changed

google/cloud/bigquery/dataset.py

+8-8
Original file line numberDiff line numberDiff line change
@@ -216,8 +216,8 @@ def default_table_expiration_ms(self):
216216
def default_table_expiration_ms(self, value):
217217
"""Update default expiration time for tables in the dataset.
218218
219-
:type value: int, or ``NoneType``
220-
:param value: new default time, in milliseconds
219+
:type value: int
220+
:param value: (Optional) new default time, in milliseconds
221221
222222
:raises: ValueError for invalid value types.
223223
"""
@@ -238,8 +238,8 @@ def description(self):
238238
def description(self, value):
239239
"""Update description of the dataset.
240240
241-
:type value: str, or ``NoneType``
242-
:param value: new description
241+
:type value: str
242+
:param value: (Optional) new description
243243
244244
:raises: ValueError for invalid value types.
245245
"""
@@ -260,8 +260,8 @@ def friendly_name(self):
260260
def friendly_name(self, value):
261261
"""Update title of the dataset.
262262
263-
:type value: str, or ``NoneType``
264-
:param value: new title
263+
:type value: str
264+
:param value: (Optional) new title
265265
266266
:raises: ValueError for invalid value types.
267267
"""
@@ -282,8 +282,8 @@ def location(self):
282282
def location(self, value):
283283
"""Update location in which the dataset is hosted.
284284
285-
:type value: str, or ``NoneType``
286-
:param value: new location
285+
:type value: str
286+
:param value: (Optional) new location
287287
288288
:raises: ValueError for invalid value types.
289289
"""

google/cloud/bigquery/query.py

+8-8
Original file line numberDiff line numberDiff line change
@@ -345,17 +345,17 @@ def fetch_data(self, max_results=None, page_token=None, start_index=None,
345345
See:
346346
https://cloud.google.com/bigquery/docs/reference/v2/jobs/getQueryResults
347347
348-
:type max_results: int or ``NoneType``
349-
:param max_results: maximum number of rows to return.
348+
:type max_results: int
349+
:param max_results: (Optional) maximum number of rows to return.
350350
351-
:type page_token: str or ``NoneType``
352-
:param page_token: token representing a cursor into the table's rows.
351+
:type page_token: str
352+
:param page_token: (Optional) token representing a cursor into the table's rows.
353353
354-
:type start_index: int or ``NoneType``
355-
:param start_index: zero-based index of starting row
354+
:type start_index: int
355+
:param start_index: (Optional) zero-based index of starting row
356356
357-
:type timeout_ms: int or ``NoneType``
358-
:param timeout_ms: timeout, in milliseconds, to wait for query to
357+
:type timeout_ms: int
358+
:param timeout_ms: (Optional) timeout, in milliseconds, to wait for query to
359359
complete
360360
361361
:type client: :class:`~google.cloud.bigquery.client.Client` or

google/cloud/bigquery/table.py

+32-31
Original file line numberDiff line numberDiff line change
@@ -264,8 +264,8 @@ def description(self):
264264
def description(self, value):
265265
"""Update description of the table.
266266
267-
:type value: str, or ``NoneType``
268-
:param value: new description
267+
:type value: str
268+
:param value: (Optional) new description
269269
270270
:raises: ValueError for invalid value types.
271271
"""
@@ -289,8 +289,8 @@ def expires(self):
289289
def expires(self, value):
290290
"""Update datetime at which the table will be removed.
291291
292-
:type value: ``datetime.datetime``, or ``NoneType``
293-
:param value: the new expiration time, or None
292+
:type value: ``datetime.datetime``
293+
:param value: (Optional) the new expiration time, or None
294294
"""
295295
if not isinstance(value, datetime.datetime) and value is not None:
296296
raise ValueError("Pass a datetime, or None")
@@ -309,8 +309,8 @@ def friendly_name(self):
309309
def friendly_name(self, value):
310310
"""Update title of the table.
311311
312-
:type value: str, or ``NoneType``
313-
:param value: new title
312+
:type value: str
313+
:param value: (Optional) new title
314314
315315
:raises: ValueError for invalid value types.
316316
"""
@@ -331,8 +331,8 @@ def location(self):
331331
def location(self, value):
332332
"""Update location in which the table is hosted.
333333
334-
:type value: str, or ``NoneType``
335-
:param value: new location
334+
:type value: str
335+
:param value: (Optional) new location
336336
337337
:raises: ValueError for invalid value types.
338338
"""
@@ -554,17 +554,17 @@ def patch(self,
554554
:param client: the client to use. If not passed, falls back to the
555555
``client`` stored on the current dataset.
556556
557-
:type friendly_name: str or ``NoneType``
558-
:param friendly_name: point in time at which the table expires.
557+
:type friendly_name: str
558+
:param friendly_name: (Optional) point in time at which the table expires.
559559
560-
:type description: str or ``NoneType``
561-
:param description: point in time at which the table expires.
560+
:type description: str
561+
:param description: (Optional) point in time at which the table expires.
562562
563-
:type location: str or ``NoneType``
564-
:param location: point in time at which the table expires.
563+
:type location: str
564+
:param location: (Optional) point in time at which the table expires.
565565
566-
:type expires: :class:`datetime.datetime` or ``NoneType``
567-
:param expires: point in time at which the table expires.
566+
:type expires: :class:`datetime.datetime`
567+
:param expires: (Optional) point in time at which the table expires.
568568
569569
:type view_query: str
570570
:param view_query: SQL query defining the table as a view
@@ -654,11 +654,12 @@ def fetch_data(self, max_results=None, page_token=None, client=None):
654654
incomplete. To ensure that the local copy of the schema is
655655
up-to-date, call the table's ``reload`` method.
656656
657-
:type max_results: int or ``NoneType``
658-
:param max_results: maximum number of rows to return.
657+
:type max_results: int
658+
:param max_results: (Optional) maximum number of rows to return.
659659
660-
:type page_token: str or ``NoneType``
661-
:param page_token: token representing a cursor into the table's rows.
660+
:type page_token: str
661+
:param page_token:
662+
(Optional) token representing a cursor into the table's rows.
662663
663664
:type client: :class:`~google.cloud.bigquery.client.Client` or
664665
``NoneType``
@@ -714,18 +715,18 @@ def insert_data(self,
714715
:param row_ids: Unique ids, one per row being inserted. If not
715716
passed, no de-duplication occurs.
716717
717-
:type skip_invalid_rows: bool or ``NoneType``
718-
:param skip_invalid_rows: skip rows w/ invalid data?
718+
:type skip_invalid_rows: bool
719+
:param skip_invalid_rows: (Optional) skip rows w/ invalid data?
719720
720-
:type ignore_unknown_values: bool or ``NoneType``
721-
:param ignore_unknown_values: ignore columns beyond schema?
722-
723-
:type template_suffix: str or ``NoneType``
724-
:param template_suffix: treat ``name`` as a template table and provide
725-
a suffix. BigQuery will create the table
726-
``<name> + <template_suffix>`` based on the
727-
schema of the template table. See:
728-
https://cloud.google.com/bigquery/streaming-data-into-bigquery#template-tables
721+
:type ignore_unknown_values: bool
722+
:param ignore_unknown_values: (Optional) ignore columns beyond schema?
723+
724+
:type template_suffix: str
725+
:param template_suffix:
726+
(Optional) treat ``name`` as a template table and provide a suffix.
727+
BigQuery will create the table ``<name> + <template_suffix>`` based
728+
on the schema of the template table. See:
729+
https://cloud.google.com/bigquery/streaming-data-into-bigquery#template-tables
729730
730731
:type client: :class:`~google.cloud.bigquery.client.Client` or
731732
``NoneType``

0 commit comments

Comments
 (0)