diff --git a/gcloud/bigquery/client.py b/gcloud/bigquery/client.py index 9b9f04d9267a..0d429ecc8dec 100644 --- a/gcloud/bigquery/client.py +++ b/gcloud/bigquery/client.py @@ -28,7 +28,7 @@ class Client(JSONClient): """Client to bundle configuration needed for API requests. - :type project: string + :type project: str :param project: the project which the client acts on behalf of. Will be passed when creating a dataset / job. If not passed, falls back to the default inferred from the environment. @@ -62,7 +62,7 @@ def list_datasets(self, include_all=False, max_results=None, :param max_results: maximum number of datasets to return, If not passed, defaults to a value set by the API. - :type page_token: string + :type page_token: str :param page_token: opaque marker for the next "page" of datasets. If not passed, the API will return the first page of datasets. @@ -94,7 +94,7 @@ def list_datasets(self, include_all=False, max_results=None, def dataset(self, dataset_name): """Construct a dataset bound to this client. - :type dataset_name: string + :type dataset_name: str :param dataset_name: Name of the dataset. :rtype: :class:`gcloud.bigquery.dataset.Dataset` @@ -108,7 +108,7 @@ def job_from_resource(self, resource): :type resource: dict :param resource: one job resource from API response - :rtype; One of: + :rtype: One of: :class:`gcloud.bigquery.job.LoadTableFromStorageJob`, :class:`gcloud.bigquery.job.CopyJob`, :class:`gcloud.bigquery.job.ExtractTableToStorageJob`, @@ -138,7 +138,7 @@ def list_jobs(self, max_results=None, page_token=None, all_users=None, :param max_results: maximum number of jobs to return, If not passed, defaults to a value set by the API. - :type page_token: string + :type page_token: str :param page_token: opaque marker for the next "page" of jobs. If not passed, the API will return the first page of jobs. @@ -147,7 +147,7 @@ def list_jobs(self, max_results=None, page_token=None, all_users=None, :param all_users: if true, include jobs owned by all users in the project. - :type state_filter: string + :type state_filter: str :param state_filter: if passed, include only jobs matching the given state. One of @@ -187,7 +187,7 @@ def load_table_from_storage(self, job_name, destination, *source_uris): See: https://cloud.google.com/bigquery/docs/reference/v2/jobs#configuration.load - :type job_name: string + :type job_name: str :param job_name: Name of the job. :type destination: :class:`gcloud.bigquery.table.Table` @@ -209,7 +209,7 @@ def copy_table(self, job_name, destination, *sources): See: https://cloud.google.com/bigquery/docs/reference/v2/jobs#configuration.copy - :type job_name: string + :type job_name: str :param job_name: Name of the job. :type destination: :class:`gcloud.bigquery.table.Table` @@ -229,7 +229,7 @@ def extract_table_to_storage(self, job_name, source, *destination_uris): See: https://cloud.google.com/bigquery/docs/reference/v2/jobs#configuration.extract - :type job_name: string + :type job_name: str :param job_name: Name of the job. :type source: :class:`gcloud.bigquery.table.Table` @@ -252,10 +252,10 @@ def run_async_query(self, job_name, query): See: https://cloud.google.com/bigquery/docs/reference/v2/jobs#configuration.query - :type job_name: string + :type job_name: str :param job_name: Name of the job. - :type query: string + :type query: str :param query: SQL query to be executed :rtype: :class:`gcloud.bigquery.job.QueryJob` @@ -266,7 +266,7 @@ def run_async_query(self, job_name, query): def run_sync_query(self, query): """Run a SQL query synchronously. - :type query: string + :type query: str :param query: SQL query to be executed :rtype: :class:`gcloud.bigquery.query.QueryResults` diff --git a/gcloud/bigquery/table.py b/gcloud/bigquery/table.py index 56e4f7eebe7b..9a0b308d110e 100644 --- a/gcloud/bigquery/table.py +++ b/gcloud/bigquery/table.py @@ -37,18 +37,18 @@ class SchemaField(object): """Describe a single field within a table schema. - :type name: string + :type name: str :param name: the name of the field - :type field_type: string + :type field_type: str :param field_type: the type of the field (one of 'STRING', 'INTEGER', 'FLOAT', 'BOOLEAN', 'TIMESTAMP' or 'RECORD') - :type mode: string + :type mode: str :param mode: the type of the field (one of 'NULLABLE', 'REQUIRED', or 'REPEATED') - :type description: string + :type description: str :param description: optional description for the field :type fields: list of :class:`SchemaField`, or None @@ -69,7 +69,7 @@ class Table(object): See: https://cloud.google.com/bigquery/docs/reference/v2/tables - :type name: string + :type name: str :param name: the name of the table :type dataset: :class:`gcloud.bigquery.dataset.Dataset` @@ -92,7 +92,7 @@ def __init__(self, name, dataset, schema=()): def project(self): """Project bound to the table. - :rtype: string + :rtype: str :returns: the project (derived from the dataset). """ return self._dataset.project @@ -101,7 +101,7 @@ def project(self): def dataset_name(self): """Name of dataset containing the table. - :rtype: string + :rtype: str :returns: the ID (derived from the dataset). """ return self._dataset.name @@ -110,7 +110,7 @@ def dataset_name(self): def path(self): """URL path for the table's APIs. - :rtype: string + :rtype: str :returns: the path based on project and dataste name. """ return '%s/tables/%s' % (self._dataset.path, self.name) @@ -154,7 +154,7 @@ def created(self): def etag(self): """ETag for the table resource. - :rtype: string, or ``NoneType`` + :rtype: str, or ``NoneType`` :returns: the ETag (None until set from the server). """ return self._properties.get('etag') @@ -197,7 +197,7 @@ def num_rows(self): def self_link(self): """URL for the table resource. - :rtype: string, or ``NoneType`` + :rtype: str, or ``NoneType`` :returns: the URL (None until set from the server). """ return self._properties.get('selfLink') @@ -206,7 +206,7 @@ def self_link(self): def table_id(self): """ID for the table resource. - :rtype: string, or ``NoneType`` + :rtype: str, or ``NoneType`` :returns: the ID (None until set from the server). """ return self._properties.get('id') @@ -217,7 +217,7 @@ def table_type(self): Possible values are "TABLE" or "VIEW". - :rtype: string, or ``NoneType`` + :rtype: str, or ``NoneType`` :returns: the URL (None until set from the server). """ return self._properties.get('type') @@ -226,7 +226,7 @@ def table_type(self): def description(self): """Description of the table. - :rtype: string, or ``NoneType`` + :rtype: str, or ``NoneType`` :returns: The description as set by the user, or None (the default). """ return self._properties.get('description') @@ -235,7 +235,7 @@ def description(self): def description(self, value): """Update description of the table. - :type value: string, or ``NoneType`` + :type value: str, or ``NoneType`` :param value: new description :raises: ValueError for invalid value types. @@ -271,7 +271,7 @@ def expires(self, value): def friendly_name(self): """Title of the table. - :rtype: string, or ``NoneType`` + :rtype: str, or ``NoneType`` :returns: The name as set by the user, or None (the default). """ return self._properties.get('friendlyName') @@ -280,7 +280,7 @@ def friendly_name(self): def friendly_name(self, value): """Update title of the table. - :type value: string, or ``NoneType`` + :type value: str, or ``NoneType`` :param value: new title :raises: ValueError for invalid value types. @@ -293,7 +293,7 @@ def friendly_name(self, value): def location(self): """Location in which the table is hosted. - :rtype: string, or ``NoneType`` + :rtype: str, or ``NoneType`` :returns: The location as set by the user, or None (the default). """ return self._properties.get('location') @@ -302,7 +302,7 @@ def location(self): def location(self, value): """Update location in which the table is hosted. - :type value: string, or ``NoneType`` + :type value: str, or ``NoneType`` :param value: new location :raises: ValueError for invalid value types. @@ -315,7 +315,7 @@ def location(self, value): def view_query(self): """SQL query defining the table as a view. - :rtype: string, or ``NoneType`` + :rtype: str, or ``NoneType`` :returns: The query as set by the user, or None (the default). """ view = self._properties.get('view') @@ -326,7 +326,7 @@ def view_query(self): def view_query(self, value): """Update SQL query defining the table as a view. - :type value: string + :type value: str :param value: new query :raises: ValueError for invalid value types. @@ -497,19 +497,19 @@ def patch(self, :param client: the client to use. If not passed, falls back to the ``client`` stored on the current dataset. - :type friendly_name: string or ``NoneType`` + :type friendly_name: str or ``NoneType`` :param friendly_name: point in time at which the table expires. - :type description: string or ``NoneType`` + :type description: str or ``NoneType`` :param description: point in time at which the table expires. - :type location: string or ``NoneType`` + :type location: str or ``NoneType`` :param location: point in time at which the table expires. :type expires: :class:`datetime.datetime` or ``NoneType`` :param expires: point in time at which the table expires. - :type view_query: string + :type view_query: str :param view_query: SQL query defining the table as a view :type schema: list of :class:`SchemaField` @@ -598,7 +598,7 @@ def fetch_data(self, max_results=None, page_token=None, client=None): :type max_results: integer or ``NoneType`` :param max_results: maximum number of rows to return. - :type page_token: string or ``NoneType`` + :type page_token: str or ``NoneType`` :param page_token: token representing a cursor into the table's rows. :type client: :class:`gcloud.bigquery.client.Client` or ``NoneType`` @@ -658,7 +658,7 @@ def insert_data(self, :type ignore_unknown_values: boolean or ``NoneType`` :param ignore_unknown_values: ignore columns beyond schema? - :type template_suffix: string or ``NoneType`` + :type template_suffix: str or ``NoneType`` :param template_suffix: treat ``name`` as a template table and provide a suffix. BigQuery will create the table `` + `` based on the @@ -743,7 +743,7 @@ def upload_from_file(self, # pylint: disable=R0913,R0914 :type file_obj: file :param file_obj: A file handle open for reading. - :type source_format: string + :type source_format: str :param source_format: one of 'CSV' or 'NEWLINE_DELIMITED_JSON'. job configuration option; see :meth:`gcloud.bigquery.job.LoadJob` @@ -769,15 +769,15 @@ def upload_from_file(self, # pylint: disable=R0913,R0914 :param allow_quoted_newlines: job configuration option; see :meth:`gcloud.bigquery.job.LoadJob` - :type create_disposition: string + :type create_disposition: str :param create_disposition: job configuration option; see :meth:`gcloud.bigquery.job.LoadJob` - :type encoding: string + :type encoding: str :param encoding: job configuration option; see :meth:`gcloud.bigquery.job.LoadJob` - :type field_delimiter: string + :type field_delimiter: str :param field_delimiter: job configuration option; see :meth:`gcloud.bigquery.job.LoadJob` @@ -789,7 +789,7 @@ def upload_from_file(self, # pylint: disable=R0913,R0914 :param max_bad_records: job configuration option; see :meth:`gcloud.bigquery.job.LoadJob` - :type quote_character: string + :type quote_character: str :param quote_character: job configuration option; see :meth:`gcloud.bigquery.job.LoadJob` @@ -797,7 +797,7 @@ def upload_from_file(self, # pylint: disable=R0913,R0914 :param skip_leading_rows: job configuration option; see :meth:`gcloud.bigquery.job.LoadJob` - :type write_disposition: string + :type write_disposition: str :param write_disposition: job configuration option; see :meth:`gcloud.bigquery.job.LoadJob` @@ -969,7 +969,7 @@ def _build_schema_resource(fields): :param fields: schema to be dumped :rtype: mapping - :returns; a mapping describing the schema of the supplied fields. + :returns: a mapping describing the schema of the supplied fields. """ infos = [] for field in fields: diff --git a/gcloud/logging/client.py b/gcloud/logging/client.py index fd79d3100aa3..3ce498ac28ea 100644 --- a/gcloud/logging/client.py +++ b/gcloud/logging/client.py @@ -28,7 +28,7 @@ class Client(JSONClient): """Client to bundle configuration needed for API requests. - :type project: string + :type project: str :param project: the project which the client acts on behalf of. If not passed, falls back to the default inferred from the environment. @@ -51,7 +51,7 @@ class Client(JSONClient): def logger(self, name): """Creates a logger bound to the current client. - :type name: string + :type name: str :param name: the name of the logger to be constructed. :rtype: :class:`gcloud.logging.logger.Logger` @@ -69,7 +69,7 @@ def _entry_from_resource(self, resource, loggers): :param loggers: A mapping of logger fullnames -> loggers. If not passed, the entry will have a newly-created logger. - :rtype; One of: + :rtype: One of: :class:`gcloud.logging.entries.TextEntry`, :class:`gcloud.logging.entries.StructEntry`, :class:`gcloud.logging.entries.ProtobufEntry` @@ -94,11 +94,11 @@ def list_entries(self, projects=None, filter_=None, order_by=None, :param projects: project IDs to include. If not passed, defaults to the project bound to the client. - :type filter_: string + :type filter_: str :param filter_: a filter expression. See: https://cloud.google.com/logging/docs/view/advanced_filters - :type order_by: string + :type order_by: str :param order_by: One of :data:`gcloud.logging.ASCENDING` or :data:`gcloud.logging.DESCENDING`. @@ -106,7 +106,7 @@ def list_entries(self, projects=None, filter_=None, order_by=None, :param page_size: maximum number of entries to return, If not passed, defaults to a value set by the API. - :type page_token: string + :type page_token: str :param page_token: opaque marker for the next "page" of entries. If not passed, the API will return the first page of entries. @@ -144,14 +144,14 @@ def list_entries(self, projects=None, filter_=None, order_by=None, def sink(self, name, filter_, destination): """Creates a sink bound to the current client. - :type name: string + :type name: str :param name: the name of the sink to be constructed. - :type filter_: string + :type filter_: str :param filter_: the advanced logs filter expression defining the entries exported by the sink. - :type destination: string + :type destination: str :param destination: destination URI for the entries exported by the sink. @@ -170,7 +170,7 @@ def list_sinks(self, page_size=None, page_token=None): :param page_size: maximum number of sinks to return, If not passed, defaults to a value set by the API. - :type page_token: string + :type page_token: str :param page_token: opaque marker for the next "page" of sinks. If not passed, the API will return the first page of sinks. @@ -199,14 +199,14 @@ def list_sinks(self, page_size=None, page_token=None): def metric(self, name, filter_, description=''): """Creates a metric bound to the current client. - :type name: string + :type name: str :param name: the name of the metric to be constructed. - :type filter_: string + :type filter_: str :param filter_: the advanced logs filter expression defining the entries tracked by the metric. - :type description: string + :type description: str :param description: the description of the metric to be constructed. :rtype: :class:`gcloud.logging.metric.Metric` @@ -224,7 +224,7 @@ def list_metrics(self, page_size=None, page_token=None): :param page_size: maximum number of metrics to return, If not passed, defaults to a value set by the API. - :type page_token: string + :type page_token: str :param page_token: opaque marker for the next "page" of metrics. If not passed, the API will return the first page of metrics. diff --git a/gcloud/monitoring/query.py b/gcloud/monitoring/query.py index 7ae94ef75bba..91838b6b52eb 100644 --- a/gcloud/monitoring/query.py +++ b/gcloud/monitoring/query.py @@ -219,6 +219,7 @@ def select_projects(self, *args): query = query.select_projects('project-1') query = query.select_projects('project-1', 'project-2') + :type args: tuple :param args: Project IDs limiting the resources to be included in the query. @@ -268,10 +269,12 @@ def select_resources(self, *args, **kwargs): not a resource label. You would filter on it using ``select_metrics(instance_name=...)``. + :type args: tuple :param args: Raw filter expression strings to include in the conjunction. If just one is provided and no keyword arguments are provided, it can be a disjunction. + :type kwargs: dict :param kwargs: Label filters to include in the conjunction as described above. @@ -309,10 +312,12 @@ def select_metrics(self, *args, **kwargs): metric.label.