From acc6a1c9ae0fa9aad777259f8ccbd5a86ac2888c Mon Sep 17 00:00:00 2001 From: Tim Swast Date: Thu, 20 Oct 2016 16:20:20 -0700 Subject: [PATCH 1/2] Replace integer with int in types. Uses the command: ag -l 'type ([^:]+): integer' | \ xargs gsed -r -i.bak -e 's/type ([^:]+): integer/type \1: int/g' --- bigquery/google/cloud/bigquery/dataset.py | 2 +- bigquery/google/cloud/bigquery/query.py | 6 +-- bigquery/google/cloud/bigquery/table.py | 8 ++-- .../google/cloud/streaming/buffered_stream.py | 6 +-- core/google/cloud/streaming/exceptions.py | 2 +- core/google/cloud/streaming/http_wrapper.py | 8 ++-- core/google/cloud/streaming/stream_slice.py | 4 +- core/google/cloud/streaming/transfer.py | 42 +++++++++---------- core/google/cloud/streaming/util.py | 2 +- datastore/google/cloud/datastore/query.py | 8 ++-- dns/google/cloud/dns/resource_record_set.py | 2 +- dns/google/cloud/dns/zone.py | 2 +- monitoring/google/cloud/monitoring/client.py | 6 +-- monitoring/google/cloud/monitoring/query.py | 16 +++---- storage/google/cloud/storage/_helpers.py | 2 +- storage/google/cloud/storage/blob.py | 6 +-- storage/google/cloud/storage/bucket.py | 2 +- storage/google/cloud/storage/client.py | 2 +- 18 files changed, 63 insertions(+), 63 deletions(-) diff --git a/bigquery/google/cloud/bigquery/dataset.py b/bigquery/google/cloud/bigquery/dataset.py index ce30fea3e4d3..3f32d1765286 100644 --- a/bigquery/google/cloud/bigquery/dataset.py +++ b/bigquery/google/cloud/bigquery/dataset.py @@ -216,7 +216,7 @@ def default_table_expiration_ms(self): def default_table_expiration_ms(self, value): """Update default expiration time for tables in the dataset. - :type value: integer, or ``NoneType`` + :type value: int, or ``NoneType`` :param value: new default time, in milliseconds :raises: ValueError for invalid value types. diff --git a/bigquery/google/cloud/bigquery/query.py b/bigquery/google/cloud/bigquery/query.py index 6146c0431657..fe9417ba379d 100644 --- a/bigquery/google/cloud/bigquery/query.py +++ b/bigquery/google/cloud/bigquery/query.py @@ -345,16 +345,16 @@ def fetch_data(self, max_results=None, page_token=None, start_index=None, See: https://cloud.google.com/bigquery/docs/reference/v2/jobs/getQueryResults - :type max_results: integer or ``NoneType`` + :type max_results: int or ``NoneType`` :param max_results: maximum number of rows to return. :type page_token: string or ``NoneType`` :param page_token: token representing a cursor into the table's rows. - :type start_index: integer or ``NoneType`` + :type start_index: int or ``NoneType`` :param start_index: zero-based index of starting row - :type timeout_ms: integer or ``NoneType`` + :type timeout_ms: int or ``NoneType`` :param timeout_ms: timeout, in milliseconds, to wait for query to complete diff --git a/bigquery/google/cloud/bigquery/table.py b/bigquery/google/cloud/bigquery/table.py index a2d7a9a761e8..d352d5edfeb3 100644 --- a/bigquery/google/cloud/bigquery/table.py +++ b/bigquery/google/cloud/bigquery/table.py @@ -654,7 +654,7 @@ def fetch_data(self, max_results=None, page_token=None, client=None): incomplete. To ensure that the local copy of the schema is up-to-date, call the table's ``reload`` method. - :type max_results: integer or ``NoneType`` + :type max_results: int or ``NoneType`` :param max_results: maximum number of rows to return. :type page_token: str or ``NoneType`` @@ -836,7 +836,7 @@ def upload_from_file(self, :func:`os.fstat`. (If the file handle is not from the filesystem this won't be possible.) - :type num_retries: integer + :type num_retries: int :param num_retries: Number of upload retries. Defaults to 6. :type allow_jagged_rows: boolean @@ -863,7 +863,7 @@ def upload_from_file(self, :param ignore_unknown_values: job configuration option; see :meth:`google.cloud.bigquery.job.LoadJob`. - :type max_bad_records: integer + :type max_bad_records: int :param max_bad_records: job configuration option; see :meth:`google.cloud.bigquery.job.LoadJob`. @@ -871,7 +871,7 @@ def upload_from_file(self, :param quote_character: job configuration option; see :meth:`google.cloud.bigquery.job.LoadJob`. - :type skip_leading_rows: integer + :type skip_leading_rows: int :param skip_leading_rows: job configuration option; see :meth:`google.cloud.bigquery.job.LoadJob`. diff --git a/core/google/cloud/streaming/buffered_stream.py b/core/google/cloud/streaming/buffered_stream.py index b9a3d2ff84d1..ed1f168b631d 100644 --- a/core/google/cloud/streaming/buffered_stream.py +++ b/core/google/cloud/streaming/buffered_stream.py @@ -24,10 +24,10 @@ class BufferedStream(object): :type stream: readable file-like object :param stream: the stream to be buffered - :type start: integer + :type start: int :param start: the starting point in the stream - :type size: integer + :type size: int :param size: the size of the buffer """ def __init__(self, stream, start, size): @@ -81,7 +81,7 @@ def _bytes_remaining(self): def read(self, size=None): """Read bytes from the buffer. - :type size: integer or None + :type size: int or None :param size: How many bytes to read (defaults to all remaining bytes). :rtype: str diff --git a/core/google/cloud/streaming/exceptions.py b/core/google/cloud/streaming/exceptions.py index 0a7e4b94815e..5b28dd50b014 100644 --- a/core/google/cloud/streaming/exceptions.py +++ b/core/google/cloud/streaming/exceptions.py @@ -97,7 +97,7 @@ class RetryAfterError(HttpError): :type url: string :param url: URL of the response which returned the error. - :type retry_after: integer + :type retry_after: int :param retry_after: seconds to wait before retrying. """ def __init__(self, response, content, url, retry_after): diff --git a/core/google/cloud/streaming/http_wrapper.py b/core/google/cloud/streaming/http_wrapper.py index 398c9f2f572f..deb79f53c920 100644 --- a/core/google/cloud/streaming/http_wrapper.py +++ b/core/google/cloud/streaming/http_wrapper.py @@ -77,7 +77,7 @@ def _httplib2_debug_level(http_request, level, http=None): :type http_request: :class:`Request` :param http_request: the request to be logged. - :type level: integer + :type level: int :param level: the debuglevel for logging. :type http: :class:`httplib2.Http`, or ``None`` @@ -319,7 +319,7 @@ def _make_api_request_no_retry(http, http_request, redirections=_REDIRECTIONS): :type http_request: :class:`Request` :param http_request: the request to send. - :type redirections: integer + :type redirections: int :param redirections: Number of redirects to follow. :rtype: :class:`Response` @@ -363,11 +363,11 @@ def make_api_request(http, http_request, retries=7, :type http_request: :class:`Request` :param http_request: the request to send. - :type retries: integer + :type retries: int :param retries: Number of retries to attempt on retryable responses (such as 429 or 5XX). - :type redirections: integer + :type redirections: int :param redirections: Number of redirects to follow. :rtype: :class:`Response` diff --git a/core/google/cloud/streaming/stream_slice.py b/core/google/cloud/streaming/stream_slice.py index dc2c3229d6f9..6bc1ab98a938 100644 --- a/core/google/cloud/streaming/stream_slice.py +++ b/core/google/cloud/streaming/stream_slice.py @@ -23,7 +23,7 @@ class StreamSlice(object): :type stream: readable file-like object :param stream: the stream to be buffered. - :type max_bytes: integer + :type max_bytes: int :param max_bytes: maximum number of bytes to return in the slice. """ def __init__(self, stream, max_bytes): @@ -65,7 +65,7 @@ def read(self, size=None): slice indicates we should still be able to read more bytes, we raise :exc:`IncompleteRead`. - :type size: integer or None + :type size: int or None :param size: If provided, read no more than size bytes from the stream. :rtype: bytes diff --git a/core/google/cloud/streaming/transfer.py b/core/google/cloud/streaming/transfer.py index 196a388f3237..8349198cf0be 100644 --- a/core/google/cloud/streaming/transfer.py +++ b/core/google/cloud/streaming/transfer.py @@ -55,7 +55,7 @@ class _Transfer(object): :type close_stream: boolean :param close_stream: should this instance close the stream when deleted - :type chunksize: integer + :type chunksize: int :param chunksize: the size of chunks used to download/upload a file. :type auto_transfer: boolean @@ -65,7 +65,7 @@ class _Transfer(object): :type http: :class:`httplib2.Http` (or workalike) :param http: Http instance used to perform requests. - :type num_retries: integer + :type num_retries: int :param num_retries: how many retries should the transfer attempt """ @@ -140,7 +140,7 @@ def num_retries(self): def num_retries(self, value): """Update how many retries should the transfer attempt - :type value: integer + :type value: int """ if not isinstance(value, six.integer_types): raise ValueError("num_retries: pass an integer") @@ -280,7 +280,7 @@ def from_stream(cls, stream, auto_transfer=True, total_size=None, **kwds): :type stream: writable file-like object :param stream: the target file - :type total_size: integer or None + :type total_size: int or None :param total_size: total size of the file to be downloaded :type auto_transfer: boolean @@ -392,11 +392,11 @@ def initialize_download(self, http_request, http): def _normalize_start_end(self, start, end=None): """Validate / fix up byte range. - :type start: integer + :type start: int :param start: start byte of the range: if negative, used as an offset from the end. - :type end: integer + :type end: int :param end: end byte of the range. :rtype: tuple, (start, end) @@ -428,11 +428,11 @@ def _set_range_header(request, start, end=None): :type request: :class:`google.cloud.streaming.http_wrapper.Request` :param request: the request to update - :type start: integer + :type start: int :param start: start byte of the range: if negative, used as an offset from the end. - :type end: integer + :type end: int :param end: end byte of the range. """ if start < 0: @@ -454,10 +454,10 @@ def _compute_end_byte(self, start, end=None, use_chunks=True): - if we have no information about size, and don't want to use the chunksize, we'll return None. - :type start: integer + :type start: int :param start: start byte of the range. - :type end: integer or None + :type end: int or None :param end: suggested last byte of the range. :type use_chunks: boolean @@ -490,10 +490,10 @@ def _compute_end_byte(self, start, end=None, use_chunks=True): def _get_chunk(self, start, end): """Retrieve a chunk of the file. - :type start: integer + :type start: int :param start: start byte of the range. - :type end: integer or None + :type end: int or None :param end: end byte of the range. :rtype: :class:`google.cloud.streaming.http_wrapper.Response` @@ -552,10 +552,10 @@ def get_range(self, start, end=None, use_chunks=True): (These variations correspond to those described in the HTTP 1.1 protocol for range headers in RFC 2616, sec. 14.35.1.) - :type start: integer + :type start: int :param start: Where to start fetching bytes. (See above.) - :type end: integer or ``None`` + :type end: int or ``None`` :param end: Where to stop fetching bytes. (See above.) :type use_chunks: boolean @@ -625,7 +625,7 @@ class Upload(_Transfer): :type mime_type: string: :param mime_type: MIME type of the upload. - :type total_size: integer or None + :type total_size: int or None :param total_size: Total upload size for the stream. :type http: :class:`httplib2.Http` (or workalike) @@ -700,7 +700,7 @@ def from_stream(cls, stream, mime_type, :type mime_type: string :param mime_type: MIMEtype of the file being uploaded - :type total_size: integer or None + :type total_size: int or None :param total_size: Size of the file being uploaded :type auto_transfer: boolean or None @@ -784,7 +784,7 @@ def total_size(self): def total_size(self, value): """Update total size of the stream to be uploaded. - :type value: integer or None + :type value: int or None :param value: the size """ self._ensure_uninitialized() @@ -1048,7 +1048,7 @@ def _validate_chunksize(self, chunksize=None): Helper for :meth:`stream_file`. - :type chunksize: integer or None + :type chunksize: int or None :param chunksize: the chunk size to be tested. :raises: :exc:`ValueError` if ``chunksize`` is not a multiple @@ -1112,7 +1112,7 @@ def _send_media_request(self, request, end): :type request: :class:`google.cloud.streaming.http_wrapper.Request` :param request: the request to upload - :type end: integer + :type end: int :param end: end byte of the to be uploaded :rtype: :class:`google.cloud.streaming.http_wrapper.Response` @@ -1140,7 +1140,7 @@ def _send_media_body(self, start): Helper for :meth:`stream_file`: - :type start: integer + :type start: int :param start: start byte of the range. :rtype: :class:`google.cloud.streaming.http_wrapper.Response` @@ -1170,7 +1170,7 @@ def _send_chunk(self, start): Helper for :meth:`stream_file`: - :type start: integer + :type start: int :param start: start byte of the range. :rtype: :class:`google.cloud.streaming.http_wrapper.Response` diff --git a/core/google/cloud/streaming/util.py b/core/google/cloud/streaming/util.py index c5d1e5b082f3..7e161f26f8eb 100644 --- a/core/google/cloud/streaming/util.py +++ b/core/google/cloud/streaming/util.py @@ -27,7 +27,7 @@ def calculate_wait_for_retry(retry_attempt): random amount of jitter is added to spread out retry attempts from different clients. - :type retry_attempt: integer + :type retry_attempt: int :param retry_attempt: Retry attempt counter. :rtype: integer diff --git a/datastore/google/cloud/datastore/query.py b/datastore/google/cloud/datastore/query.py index 954a320116a5..ecf62002ffb5 100644 --- a/datastore/google/cloud/datastore/query.py +++ b/datastore/google/cloud/datastore/query.py @@ -327,10 +327,10 @@ def fetch(self, limit=None, offset=0, start_cursor=None, end_cursor=None, >>> list(query.fetch(1)) [] - :type limit: integer or None + :type limit: int or None :param limit: An optional limit passed through to the iterator. - :type offset: integer + :type offset: int :param offset: An optional offset passed through to the iterator. :type start_cursor: bytes @@ -366,10 +366,10 @@ class Iterator(object): :type client: :class:`google.cloud.datastore.client.Client` :param client: The client used to make a request. - :type limit: integer + :type limit: int :param limit: (Optional) Limit the number of results returned. - :type offset: integer + :type offset: int :param offset: (Optional) Offset used to begin a query. :type start_cursor: bytes diff --git a/dns/google/cloud/dns/resource_record_set.py b/dns/google/cloud/dns/resource_record_set.py index 82febf2333ba..fc90918f854a 100644 --- a/dns/google/cloud/dns/resource_record_set.py +++ b/dns/google/cloud/dns/resource_record_set.py @@ -29,7 +29,7 @@ class ResourceRecordSet(object): :type record_type: string :param record_type: the RR type of the zone. - :type ttl: integer + :type ttl: int :param ttl: TTL (in seconds) for caching the record sets. :type rrdatas: list of string diff --git a/dns/google/cloud/dns/zone.py b/dns/google/cloud/dns/zone.py index c4aa77cd93cd..1cefeffe0261 100644 --- a/dns/google/cloud/dns/zone.py +++ b/dns/google/cloud/dns/zone.py @@ -180,7 +180,7 @@ def resource_record_set(self, name, record_type, ttl, rrdatas): :type record_type: string :param record_type: RR type - :type ttl: integer + :type ttl: int :param ttl: TTL for the RR, in seconds :type rrdatas: list of string diff --git a/monitoring/google/cloud/monitoring/client.py b/monitoring/google/cloud/monitoring/client.py index 5aefce1972d1..90462205937f 100644 --- a/monitoring/google/cloud/monitoring/client.py +++ b/monitoring/google/cloud/monitoring/client.py @@ -102,13 +102,13 @@ def query(self, :meth:`~google.cloud.monitoring.query.Query.select_interval` must be called before the query is executed. - :type days: integer + :type days: int :param days: The number of days in the time interval. - :type hours: integer + :type hours: int :param hours: The number of hours in the time interval. - :type minutes: integer + :type minutes: int :param minutes: The number of minutes in the time interval. :rtype: :class:`~google.cloud.monitoring.query.Query` diff --git a/monitoring/google/cloud/monitoring/query.py b/monitoring/google/cloud/monitoring/query.py index 685b21e5f1a9..c8f33f1b95b0 100644 --- a/monitoring/google/cloud/monitoring/query.py +++ b/monitoring/google/cloud/monitoring/query.py @@ -100,13 +100,13 @@ class Query(object): :meth:`~google.cloud.monitoring.query.Query.select_interval` must be called before the query is executed. - :type days: integer + :type days: int :param days: The number of days in the time interval. - :type hours: integer + :type hours: int :param hours: The number of hours in the time interval. - :type minutes: integer + :type minutes: int :param minutes: The number of minutes in the time interval. :raises: :exc:`ValueError` if ``end_time`` is specified but @@ -368,13 +368,13 @@ def align(self, per_series_aligner, seconds=0, minutes=0, hours=0): See :class:`Aligner` and the descriptions of the `supported aligners`_. - :type seconds: integer + :type seconds: int :param seconds: The number of seconds in the alignment period. - :type minutes: integer + :type minutes: int :param minutes: The number of minutes in the alignment period. - :type hours: integer + :type hours: int :param hours: The number of hours in the alignment period. :rtype: :class:`Query` @@ -446,7 +446,7 @@ def iter(self, headers_only=False, page_size=None): :param headers_only: Whether to omit the point data from the time series objects. - :type page_size: integer or None + :type page_size: int or None :param page_size: An optional positive number specifying the maximum number of points to return per page. This can be used to control how far @@ -510,7 +510,7 @@ def _build_query_params(self, headers_only=False, Whether to omit the point data from the :class:`~google.cloud.monitoring.timeseries.TimeSeries` objects. - :type page_size: integer or None + :type page_size: int or None :param page_size: A limit on the number of points to return per page. :type page_token: string or None diff --git a/storage/google/cloud/storage/_helpers.py b/storage/google/cloud/storage/_helpers.py index b7a2b690689e..7ec79d09aff3 100644 --- a/storage/google/cloud/storage/_helpers.py +++ b/storage/google/cloud/storage/_helpers.py @@ -151,7 +151,7 @@ def _write_buffer_to_hash(buffer_object, hash_obj, digest_block_size=8192): :type hash_obj: object that implements update :param hash_obj: A hash object (MD5 or CRC32-C). - :type digest_block_size: integer + :type digest_block_size: int :param digest_block_size: The block size to write to the hash. Defaults to 8192. """ diff --git a/storage/google/cloud/storage/blob.py b/storage/google/cloud/storage/blob.py index fe343afb696b..5eaef11f0471 100644 --- a/storage/google/cloud/storage/blob.py +++ b/storage/google/cloud/storage/blob.py @@ -57,7 +57,7 @@ class Blob(_PropertyMixin): :type bucket: :class:`google.cloud.storage.bucket.Bucket` :param bucket: The bucket to which this blob belongs. - :type chunk_size: integer + :type chunk_size: int :param chunk_size: The size of a chunk of data whenever iterating (1 MB). This must be a multiple of 256 KB per the API specification. @@ -94,7 +94,7 @@ def chunk_size(self): def chunk_size(self, value): """Set the blob's default chunk size. - :type value: integer or ``NoneType`` + :type value: int or ``NoneType`` :param value: The current blob's chunk size, if it is set. :raises: :class:`ValueError` if ``value`` is not ``None`` and is not a @@ -453,7 +453,7 @@ def upload_from_file(self, file_obj, rewind=False, size=None, :type content_type: string or ``NoneType`` :param content_type: Optional type of content being uploaded. - :type num_retries: integer + :type num_retries: int :param num_retries: Number of upload retries. Defaults to 6. :type client: :class:`~google.cloud.storage.client.Client` or diff --git a/storage/google/cloud/storage/bucket.py b/storage/google/cloud/storage/bucket.py index cbf663774863..c0d39a9e8a21 100644 --- a/storage/google/cloud/storage/bucket.py +++ b/storage/google/cloud/storage/bucket.py @@ -111,7 +111,7 @@ def blob(self, blob_name, chunk_size=None, encryption_key=None): :type blob_name: string :param blob_name: The name of the blob to be instantiated. - :type chunk_size: integer + :type chunk_size: int :param chunk_size: The size of a chunk of data whenever iterating (1 MB). This must be a multiple of 256 KB per the API specification. diff --git a/storage/google/cloud/storage/client.py b/storage/google/cloud/storage/client.py index a65770054495..ec0a265c6ad2 100644 --- a/storage/google/cloud/storage/client.py +++ b/storage/google/cloud/storage/client.py @@ -227,7 +227,7 @@ def list_buckets(self, max_results=None, page_token=None, prefix=None, This implements "storage.buckets.list". - :type max_results: integer or ``NoneType`` + :type max_results: int or ``NoneType`` :param max_results: Optional. Maximum number of buckets to return. :type page_token: string or ``NoneType`` From 20e8c7f8552feaf4288223cf29af468a3d5cfeab Mon Sep 17 00:00:00 2001 From: Tim Swast Date: Thu, 20 Oct 2016 16:24:00 -0700 Subject: [PATCH 2/2] Replaces integer with int in rtypes. Uses the command: ag -l 'rtype: integer' | xargs sed -i .bak 's/rtype: integer/rtype: int/g' --- bigquery/google/cloud/bigquery/dataset.py | 2 +- bigquery/google/cloud/bigquery/job.py | 8 ++++---- bigquery/google/cloud/bigquery/query.py | 4 ++-- bigquery/google/cloud/bigquery/table.py | 4 ++-- core/google/cloud/streaming/buffered_stream.py | 4 ++-- core/google/cloud/streaming/exceptions.py | 2 +- core/google/cloud/streaming/http_wrapper.py | 8 ++++---- core/google/cloud/streaming/stream_slice.py | 2 +- core/google/cloud/streaming/transfer.py | 10 +++++----- core/google/cloud/streaming/util.py | 2 +- datastore/google/cloud/datastore/key.py | 6 +++--- storage/google/cloud/storage/blob.py | 10 +++++----- storage/google/cloud/storage/bucket.py | 4 ++-- 13 files changed, 33 insertions(+), 33 deletions(-) diff --git a/bigquery/google/cloud/bigquery/dataset.py b/bigquery/google/cloud/bigquery/dataset.py index 3f32d1765286..3f7d340bd20c 100644 --- a/bigquery/google/cloud/bigquery/dataset.py +++ b/bigquery/google/cloud/bigquery/dataset.py @@ -207,7 +207,7 @@ def self_link(self): def default_table_expiration_ms(self): """Default expiration time for tables in the dataset. - :rtype: integer, or ``NoneType`` + :rtype: int, or ``NoneType`` :returns: The time in milliseconds, or None (the default). """ return self._properties.get('defaultTableExpirationMs') diff --git a/bigquery/google/cloud/bigquery/job.py b/bigquery/google/cloud/bigquery/job.py index d0155ca8b32e..f32a00544291 100644 --- a/bigquery/google/cloud/bigquery/job.py +++ b/bigquery/google/cloud/bigquery/job.py @@ -455,7 +455,7 @@ def schema(self, value): def input_file_bytes(self): """Count of bytes loaded from source files. - :rtype: integer, or ``NoneType`` + :rtype: int, or ``NoneType`` :returns: the count (None until set from the server). """ statistics = self._properties.get('statistics') @@ -466,7 +466,7 @@ def input_file_bytes(self): def input_files(self): """Count of source files. - :rtype: integer, or ``NoneType`` + :rtype: int, or ``NoneType`` :returns: the count (None until set from the server). """ statistics = self._properties.get('statistics') @@ -477,7 +477,7 @@ def input_files(self): def output_bytes(self): """Count of bytes saved to destination table. - :rtype: integer, or ``NoneType`` + :rtype: int, or ``NoneType`` :returns: the count (None until set from the server). """ statistics = self._properties.get('statistics') @@ -488,7 +488,7 @@ def output_bytes(self): def output_rows(self): """Count of rows saved to destination table. - :rtype: integer, or ``NoneType`` + :rtype: int, or ``NoneType`` :returns: the count (None until set from the server). """ statistics = self._properties.get('statistics') diff --git a/bigquery/google/cloud/bigquery/query.py b/bigquery/google/cloud/bigquery/query.py index fe9417ba379d..3192659a2095 100644 --- a/bigquery/google/cloud/bigquery/query.py +++ b/bigquery/google/cloud/bigquery/query.py @@ -197,7 +197,7 @@ def total_rows(self): See: https://cloud.google.com/bigquery/docs/reference/v2/jobs/query#totalRows - :rtype: integer, or ``NoneType`` + :rtype: int, or ``NoneType`` :returns: Count generated on the server (None until set by the server). """ return self._properties.get('totalRows') @@ -209,7 +209,7 @@ def total_bytes_processed(self): See: https://cloud.google.com/bigquery/docs/reference/v2/jobs/query#totalBytesProcessed - :rtype: integer, or ``NoneType`` + :rtype: int, or ``NoneType`` :returns: Count generated on the server (None until set by the server). """ return self._properties.get('totalBytesProcessed') diff --git a/bigquery/google/cloud/bigquery/table.py b/bigquery/google/cloud/bigquery/table.py index d352d5edfeb3..8bc68b03914c 100644 --- a/bigquery/google/cloud/bigquery/table.py +++ b/bigquery/google/cloud/bigquery/table.py @@ -151,7 +151,7 @@ def modified(self): def num_bytes(self): """The size of the table in bytes. - :rtype: integer, or ``NoneType`` + :rtype: int, or ``NoneType`` :returns: the byte count (None until set from the server). """ num_bytes_as_str = self._properties.get('numBytes') @@ -162,7 +162,7 @@ def num_bytes(self): def num_rows(self): """The number of rows in the table. - :rtype: integer, or ``NoneType`` + :rtype: int, or ``NoneType`` :returns: the row count (None until set from the server). """ num_rows_as_str = self._properties.get('numRows') diff --git a/core/google/cloud/streaming/buffered_stream.py b/core/google/cloud/streaming/buffered_stream.py index ed1f168b631d..2bfe35522c95 100644 --- a/core/google/cloud/streaming/buffered_stream.py +++ b/core/google/cloud/streaming/buffered_stream.py @@ -64,7 +64,7 @@ def stream_exhausted(self): def stream_end_position(self): """Point to which stream was read into the buffer - :rtype: integer + :rtype: int :returns: The end-position of the stream. """ return self._end_pos @@ -73,7 +73,7 @@ def stream_end_position(self): def _bytes_remaining(self): """Bytes remaining to be read from the buffer - :rtype: integer + :rtype: int :returns: The number of bytes remaining. """ return len(self._buffered_data) - self._buffer_pos diff --git a/core/google/cloud/streaming/exceptions.py b/core/google/cloud/streaming/exceptions.py index 5b28dd50b014..4c5dea915099 100644 --- a/core/google/cloud/streaming/exceptions.py +++ b/core/google/cloud/streaming/exceptions.py @@ -50,7 +50,7 @@ def __str__(self): def status_code(self): """Status code for the response. - :rtype: integer + :rtype: int :returns: the code """ return int(self.response['status']) diff --git a/core/google/cloud/streaming/http_wrapper.py b/core/google/cloud/streaming/http_wrapper.py index deb79f53c920..87bc43b2accd 100644 --- a/core/google/cloud/streaming/http_wrapper.py +++ b/core/google/cloud/streaming/http_wrapper.py @@ -191,7 +191,7 @@ def _process_content_range(content_range): :type content_range: str :param content_range: the header value being parsed. - :rtype: integer + :rtype: int :returns: the length of the response chunk. """ _, _, range_spec = content_range.partition(' ') @@ -221,7 +221,7 @@ def length(self): Exposed as an attribute since using ``len()`` directly can fail for responses larger than ``sys.maxint``. - :rtype: integer or long + :rtype: int or long :returns: The length of the response. """ if 'content-encoding' in self.info and 'content-range' in self.info: @@ -239,7 +239,7 @@ def length(self): def status_code(self): """HTTP status code - :rtype: integer + :rtype: int :returns: The response status code. """ return int(self.info['status']) @@ -248,7 +248,7 @@ def status_code(self): def retry_after(self): """Retry interval (if set). - :rtype: integer + :rtype: int :returns: interval in seconds """ if 'retry-after' in self.info: diff --git a/core/google/cloud/streaming/stream_slice.py b/core/google/cloud/streaming/stream_slice.py index 6bc1ab98a938..bb37a4446ad5 100644 --- a/core/google/cloud/streaming/stream_slice.py +++ b/core/google/cloud/streaming/stream_slice.py @@ -51,7 +51,7 @@ def length(self): For 32-bit python2.x, len() cannot exceed a 32-bit number. - :rtype: integer + :rtype: int :returns: The max "length" of the stream. """ return self._max_bytes diff --git a/core/google/cloud/streaming/transfer.py b/core/google/cloud/streaming/transfer.py index 8349198cf0be..0fd7a8c31371 100644 --- a/core/google/cloud/streaming/transfer.py +++ b/core/google/cloud/streaming/transfer.py @@ -131,7 +131,7 @@ def bytes_http(self, value): def num_retries(self): """How many retries should the transfer attempt - :rtype: integer + :rtype: int :returns: The number of retries allowed. """ return self._num_retries @@ -300,7 +300,7 @@ def from_stream(cls, stream, auto_transfer=True, total_size=None, **kwds): def progress(self): """Number of bytes have been downloaded. - :rtype: integer >= 0 + :rtype: int >= 0 :returns: The number of downloaded bytes. """ return self._progress @@ -309,7 +309,7 @@ def progress(self): def total_size(self): """Total number of bytes to be downloaded. - :rtype: integer or None + :rtype: int or None :returns: The total number of bytes to download. """ return self._total_size @@ -741,7 +741,7 @@ def mime_type(self): def progress(self): """Bytes uploaded so far - :rtype: integer + :rtype: int :returns: The amount uploaded so far. """ return self._progress @@ -775,7 +775,7 @@ def strategy(self, value): def total_size(self): """Total size of the stream to be uploaded. - :rtype: integer or None + :rtype: int or None :returns: The total size to be uploaded. """ return self._total_size diff --git a/core/google/cloud/streaming/util.py b/core/google/cloud/streaming/util.py index 7e161f26f8eb..e99784345373 100644 --- a/core/google/cloud/streaming/util.py +++ b/core/google/cloud/streaming/util.py @@ -30,7 +30,7 @@ def calculate_wait_for_retry(retry_attempt): :type retry_attempt: int :param retry_attempt: Retry attempt counter. - :rtype: integer + :rtype: int :returns: Number of seconds to wait before retrying request. """ wait_time = 2 ** retry_attempt diff --git a/datastore/google/cloud/datastore/key.py b/datastore/google/cloud/datastore/key.py index be6ca3875f16..1ae6f1d2c102 100644 --- a/datastore/google/cloud/datastore/key.py +++ b/datastore/google/cloud/datastore/key.py @@ -105,7 +105,7 @@ def __ne__(self, other): def __hash__(self): """Hash a keys for use in a dictionary lookp. - :rtype: integer + :rtype: int :returns: a hash of the key's state. """ return (hash(self.flat_path) + @@ -307,7 +307,7 @@ def kind(self): def id(self): """ID getter. Based on the last element of path. - :rtype: integer + :rtype: int :returns: The (integer) ID of the key. """ return self.path[-1].get('id') @@ -325,7 +325,7 @@ def name(self): def id_or_name(self): """Getter. Based on the last element of path. - :rtype: integer (if ``id``) or string (if ``name``) + :rtype: int (if ``id``) or string (if ``name``) :returns: The last element of the key's path if it is either an ``id`` or a ``name``. """ diff --git a/storage/google/cloud/storage/blob.py b/storage/google/cloud/storage/blob.py index 5eaef11f0471..3be905b9de09 100644 --- a/storage/google/cloud/storage/blob.py +++ b/storage/google/cloud/storage/blob.py @@ -85,7 +85,7 @@ def __init__(self, name, bucket, chunk_size=None, encryption_key=None): def chunk_size(self): """Get the blob's default chunk size. - :rtype: integer or ``NoneType`` + :rtype: int or ``NoneType`` :returns: The current blob's chunk size, if it is set. """ return self._chunk_size @@ -773,7 +773,7 @@ def component_count(self): See: https://cloud.google.com/storage/docs/json_api/v1/objects - :rtype: integer or ``NoneType`` + :rtype: int or ``NoneType`` :returns: The component count (in case of a composed object) or ``None`` if the property is not set locally. This property will not be set on objects not created via ``compose``. @@ -800,7 +800,7 @@ def generation(self): See: https://cloud.google.com/storage/docs/json_api/v1/objects - :rtype: integer or ``NoneType`` + :rtype: int or ``NoneType`` :returns: The generation of the blob or ``None`` if the property is not set locally. """ @@ -872,7 +872,7 @@ def metageneration(self): See: https://cloud.google.com/storage/docs/json_api/v1/objects - :rtype: integer or ``NoneType`` + :rtype: int or ``NoneType`` :returns: The metageneration of the blob or ``None`` if the property is not set locally. """ @@ -910,7 +910,7 @@ def size(self): See: https://cloud.google.com/storage/docs/json_api/v1/objects - :rtype: integer or ``NoneType`` + :rtype: int or ``NoneType`` :returns: The size of the blob or ``None`` if the property is not set locally. """ diff --git a/storage/google/cloud/storage/bucket.py b/storage/google/cloud/storage/bucket.py index c0d39a9e8a21..d9cc6137682b 100644 --- a/storage/google/cloud/storage/bucket.py +++ b/storage/google/cloud/storage/bucket.py @@ -626,7 +626,7 @@ def metageneration(self): See: https://cloud.google.com/storage/docs/json_api/v1/buckets - :rtype: integer or ``NoneType`` + :rtype: int or ``NoneType`` :returns: The metageneration of the bucket or ``None`` if the property is not set locally. """ @@ -652,7 +652,7 @@ def project_number(self): See: https://cloud.google.com/storage/docs/json_api/v1/buckets - :rtype: integer or ``NoneType`` + :rtype: int or ``NoneType`` :returns: The project number that owns the bucket or ``None`` if the property is not set locally. """