Skip to content

Commit b2d6a2c

Browse files
authored
Merge pull request #2579 from tswast/str-not-string
Replace types string with str.
2 parents 9a5e79a + c92e40d commit b2d6a2c

File tree

9 files changed

+73
-73
lines changed

9 files changed

+73
-73
lines changed

packages/google-cloud-monitoring/google/cloud/monitoring/_dataframe.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ def _build_dataframe(time_series_iterable,
3434
:param time_series_iterable:
3535
An iterable (e.g., a query object) yielding time series.
3636
37-
:type label: string or None
37+
:type label: str or None
3838
:param label:
3939
The label name to use for the dataframe header. This can be the name
4040
of a resource label or metric label (e.g., ``"instance_name"``), or

packages/google-cloud-monitoring/google/cloud/monitoring/client.py

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
class Client(JSONClient):
5151
"""Client to bundle configuration needed for API requests.
5252
53-
:type project: string
53+
:type project: str
5454
:param project: The target project. If not passed, falls back to the
5555
default inferred from the environment.
5656
@@ -80,7 +80,7 @@ def query(self,
8080
>>> query = client.query(minutes=5)
8181
>>> print(query.as_dataframe()) # Requires pandas.
8282
83-
:type metric_type: string
83+
:type metric_type: str
8484
:param metric_type: The metric type name. The default value is
8585
:data:`Query.DEFAULT_METRIC_TYPE
8686
<google.cloud.monitoring.query.Query.DEFAULT_METRIC_TYPE>`,
@@ -158,19 +158,19 @@ def metric_descriptor(self, type_,
158158
... description='Cumulative count of HTTP responses.')
159159
>>> descriptor.create()
160160
161-
:type type_: string
161+
:type type_: str
162162
:param type_:
163163
The metric type including a DNS name prefix. For example:
164164
``"custom.googleapis.com/my_metric"``
165165
166-
:type metric_kind: string
166+
:type metric_kind: str
167167
:param metric_kind:
168168
The kind of measurement. It must be one of
169169
:data:`MetricKind.GAUGE`, :data:`MetricKind.DELTA`,
170170
or :data:`MetricKind.CUMULATIVE`.
171171
See :class:`~google.cloud.monitoring.metric.MetricKind`.
172172
173-
:type value_type: string
173+
:type value_type: str
174174
:param value_type:
175175
The value type of the metric. It must be one of
176176
:data:`ValueType.BOOL`, :data:`ValueType.INT64`,
@@ -184,13 +184,13 @@ def metric_descriptor(self, type_,
184184
A sequence of zero or more label descriptors specifying the labels
185185
used to identify a specific instance of this metric.
186186
187-
:type unit: string
187+
:type unit: str
188188
:param unit: An optional unit in which the metric value is reported.
189189
190-
:type description: string
190+
:type description: str
191191
:param description: An optional detailed description of the metric.
192192
193-
:type display_name: string
193+
:type display_name: str
194194
:param display_name: An optional concise name for the metric.
195195
196196
:rtype: :class:`MetricDescriptor`
@@ -221,7 +221,7 @@ def metric(type_, labels):
221221
... 'status': 'successful',
222222
... })
223223
224-
:type type_: string
224+
:type type_: str
225225
:param type_: The metric type name.
226226
227227
:type labels: dict
@@ -248,7 +248,7 @@ def resource(type_, labels):
248248
249249
https://cloud.google.com/monitoring/api/resources
250250
251-
:type type_: string
251+
:type type_: str
252252
:param type_: The monitored resource type name.
253253
254254
:type labels: dict
@@ -339,7 +339,7 @@ def fetch_metric_descriptor(self, metric_type):
339339
>>> METRIC = 'compute.googleapis.com/instance/cpu/utilization'
340340
>>> print(client.fetch_metric_descriptor(METRIC))
341341
342-
:type metric_type: string
342+
:type metric_type: str
343343
:param metric_type: The metric type name.
344344
345345
:rtype: :class:`~google.cloud.monitoring.metric.MetricDescriptor`
@@ -362,12 +362,12 @@ def list_metric_descriptors(self, filter_string=None, type_prefix=None):
362362
... type_prefix='custom.'):
363363
... print(descriptor.type)
364364
365-
:type filter_string: string or None
365+
:type filter_string: str or None
366366
:param filter_string:
367367
An optional filter expression describing the metric descriptors
368368
to be returned. See the `filter documentation`_.
369369
370-
:type type_prefix: string or None
370+
:type type_prefix: str or None
371371
:param type_prefix: An optional prefix constraining the selected
372372
metric types. This adds ``metric.type = starts_with("<prefix>")``
373373
to the filter.
@@ -389,7 +389,7 @@ def fetch_resource_descriptor(self, resource_type):
389389
390390
>>> print(client.fetch_resource_descriptor('gce_instance'))
391391
392-
:type resource_type: string
392+
:type resource_type: str
393393
:param resource_type: The resource type name.
394394
395395
:rtype: :class:`~google.cloud.monitoring.resource.ResourceDescriptor`
@@ -408,7 +408,7 @@ def list_resource_descriptors(self, filter_string=None):
408408
>>> for descriptor in client.list_resource_descriptors():
409409
... print(descriptor.type)
410410
411-
:type filter_string: string or None
411+
:type filter_string: str or None
412412
:param filter_string:
413413
An optional filter expression describing the resource descriptors
414414
to be returned. See the `filter documentation`_.
@@ -430,24 +430,24 @@ def group(self, group_id=None, display_name=None, parent_id=None,
430430
This will not make an HTTP request; it simply instantiates
431431
a group object owned by this client.
432432
433-
:type group_id: string or None
433+
:type group_id: str or None
434434
:param group_id: The ID of the group.
435435
436-
:type display_name: string or None
436+
:type display_name: str or None
437437
:param display_name:
438438
A user-assigned name for this group, used only for display
439439
purposes.
440440
441-
:type parent_id: string or None
441+
:type parent_id: str or None
442442
:param parent_id:
443443
The ID of the group's parent, if it has one.
444444
445-
:type filter_string: string or None
445+
:type filter_string: str or None
446446
:param filter_string:
447447
The filter string used to determine which monitored resources
448448
belong to this group.
449449
450-
:type is_cluster: boolean
450+
:type is_cluster: bool
451451
:param is_cluster:
452452
If true, the members of this group are considered to be a cluster.
453453
The system can perform additional analysis on groups that are
@@ -478,7 +478,7 @@ def fetch_group(self, group_id):
478478
>>> except google.cloud.exceptions.NotFound:
479479
>>> print('That group does not exist!')
480480
481-
:type group_id: string
481+
:type group_id: str
482482
:param group_id: The ID of the group.
483483
484484
:rtype: :class:`~google.cloud.monitoring.group.Group`

packages/google-cloud-monitoring/google/cloud/monitoring/connection.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class Connection(base_connection.JSONConnection):
2727
:type http: :class:`httplib2.Http` or class that defines ``request()``
2828
:param http: (Optional) HTTP object to make requests.
2929
30-
:type api_base_url: string
30+
:type api_base_url: str
3131
:param api_base_url: The base of the API call URL. Defaults to the value
3232
:attr:`Connection.API_BASE_URL`.
3333
"""

packages/google-cloud-monitoring/google/cloud/monitoring/group.py

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,14 @@
3838
def _group_id_from_name(path, project=None):
3939
"""Validate a group URI path and get the group ID.
4040
41-
:type path: string
41+
:type path: str
4242
:param path: URI path for a group API request.
4343
44-
:type project: string or None
44+
:type project: str or None
4545
:param project: The project associated with the request. It is
4646
included for validation purposes.
4747
48-
:rtype: string
48+
:rtype: str
4949
:returns: Group ID parsed from ``path``.
5050
:raises: :class:`ValueError` if the ``path`` is ill-formed or if
5151
the project from the ``path`` does not agree with the
@@ -57,13 +57,13 @@ def _group_id_from_name(path, project=None):
5757
def _group_name_from_id(project, group_id):
5858
"""Build the group name given the project and group ID.
5959
60-
:type project: string
60+
:type project: str
6161
:param project: The project associated with the group.
6262
63-
:type group_id: string
63+
:type group_id: str
6464
:param group_id: The group ID.
6565
66-
:rtype: string
66+
:rtype: str
6767
:returns: The fully qualified name of the group.
6868
"""
6969
return 'projects/{project}/groups/{group_id}'.format(
@@ -76,23 +76,23 @@ class Group(object):
7676
:type client: :class:`google.cloud.monitoring.client.Client`
7777
:param client: A client for operating on the metric descriptor.
7878
79-
:type group_id: string or None
79+
:type group_id: str or None
8080
:param group_id: The ID of the group.
8181
82-
:type display_name: string or None
82+
:type display_name: str or None
8383
:param display_name:
8484
A user-assigned name for this group, used only for display purposes.
8585
86-
:type parent_id: string or None
86+
:type parent_id: str or None
8787
:param parent_id:
8888
The ID of the group's parent, if it has one.
8989
90-
:type filter_string: string or None
90+
:type filter_string: str or None
9191
:param filter_string:
9292
The filter string used to determine which monitored resources belong to
9393
this group.
9494
95-
:type is_cluster: boolean
95+
:type is_cluster: bool
9696
:param is_cluster:
9797
If true, the members of this group are considered to be a cluster. The
9898
system can perform additional analysis on groups that are clusters.
@@ -296,7 +296,7 @@ def list_members(self, filter_string=None, end_time=None, start_time=None):
296296
... print(member)
297297
298298
299-
:type filter_string: string or None
299+
:type filter_string: str or None
300300
:param filter_string:
301301
An optional list filter describing the members to be returned. The
302302
filter may reference the type, labels, and metadata of monitored
@@ -365,7 +365,7 @@ def _fetch(cls, client, group_id):
365365
:type client: :class:`google.cloud.monitoring.client.Client`
366366
:param client: The client to use.
367367
368-
:type group_id: string
368+
:type group_id: str
369369
:param group_id: The group ID.
370370
371371
:rtype: :class:`Group`
@@ -386,17 +386,17 @@ def _list(cls, client, children_of_group=None, ancestors_of_group=None,
386386
:type client: :class:`google.cloud.monitoring.client.Client`
387387
:param client: The client to use.
388388
389-
:type children_of_group: string or None
389+
:type children_of_group: str or None
390390
:param children_of_group:
391391
Returns groups whose parent_name field contains the group name. If
392392
no groups have this parent, the results are empty.
393393
394-
:type ancestors_of_group: string or None
394+
:type ancestors_of_group: str or None
395395
:param ancestors_of_group:
396396
Returns groups that are ancestors of the specified group. If the
397397
specified group has no immediate parent, the results are empty.
398398
399-
:type descendants_of_group: string or None
399+
:type descendants_of_group: str or None
400400
:param descendants_of_group:
401401
Returns the descendants of the specified group. This is a superset
402402
of the results returned by the children_of_group filter, and

packages/google-cloud-monitoring/google/cloud/monitoring/label.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,16 +35,16 @@ class LabelValueType(object):
3535
class LabelDescriptor(object):
3636
"""Schema specification and documentation for a single label.
3737
38-
:type key: string
38+
:type key: str
3939
:param key: The name of the label.
4040
41-
:type value_type: string
41+
:type value_type: str
4242
:param value_type:
4343
The type of the label. It must be one of :data:`LabelValueType.STRING`,
4444
:data:`LabelValueType.BOOL`, or :data:`LabelValueType.INT64`.
4545
See :class:`LabelValueType`.
4646
47-
:type description: string
47+
:type description: str
4848
:param description: A human-readable description for the label.
4949
"""
5050

packages/google-cloud-monitoring/google/cloud/monitoring/metric.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -68,18 +68,18 @@ class MetricDescriptor(object):
6868
:type client: :class:`google.cloud.monitoring.client.Client`
6969
:param client: A client for operating on the metric descriptor.
7070
71-
:type type_: string
71+
:type type_: str
7272
:param type_:
7373
The metric type including a DNS name prefix. For example:
7474
``"compute.googleapis.com/instance/cpu/utilization"``
7575
76-
:type metric_kind: string
76+
:type metric_kind: str
7777
:param metric_kind:
7878
The kind of measurement. It must be one of
7979
:data:`MetricKind.GAUGE`, :data:`MetricKind.DELTA`,
8080
or :data:`MetricKind.CUMULATIVE`. See :class:`MetricKind`.
8181
82-
:type value_type: string
82+
:type value_type: str
8383
:param value_type:
8484
The value type of the metric. It must be one of
8585
:data:`ValueType.BOOL`, :data:`ValueType.INT64`,
@@ -93,16 +93,16 @@ class MetricDescriptor(object):
9393
A sequence of zero or more label descriptors specifying the labels
9494
used to identify a specific instance of this metric.
9595
96-
:type unit: string
96+
:type unit: str
9797
:param unit: An optional unit in which the metric value is reported.
9898
99-
:type description: string
99+
:type description: str
100100
:param description: An optional detailed description of the metric.
101101
102-
:type display_name: string
102+
:type display_name: str
103103
:param display_name: An optional concise name for the metric.
104104
105-
:type name: string or None
105+
:type name: str or None
106106
:param name:
107107
The "resource name" of the metric descriptor. For example:
108108
``"projects/<project_id>/metricDescriptors/<type>"``. As
@@ -176,7 +176,7 @@ def _fetch(cls, client, metric_type):
176176
:type client: :class:`google.cloud.monitoring.client.Client`
177177
:param client: The client to use.
178178
179-
:type metric_type: string
179+
:type metric_type: str
180180
:param metric_type: The metric type name.
181181
182182
:rtype: :class:`MetricDescriptor`
@@ -198,12 +198,12 @@ def _list(cls, client, filter_string=None, type_prefix=None):
198198
:type client: :class:`google.cloud.monitoring.client.Client`
199199
:param client: The client to use.
200200
201-
:type filter_string: string or None
201+
:type filter_string: str or None
202202
:param filter_string:
203203
An optional filter expression describing the metric descriptors
204204
to be returned. See the `filter documentation`_.
205205
206-
:type type_prefix: string or None
206+
:type type_prefix: str or None
207207
:param type_prefix: An optional prefix constraining the selected
208208
metric types. This adds ``metric.type = starts_with("<prefix>")``
209209
to the filter.
@@ -324,7 +324,7 @@ class Metric(collections.namedtuple('Metric', 'type labels')):
324324
:meth:`~google.cloud.monitoring.client.Client.metric` factory method
325325
of the :class:`~google.cloud.monitoring.client.Client` class.
326326
327-
:type type: string
327+
:type type: str
328328
:param type: The metric type name.
329329
330330
:type labels: dict

0 commit comments

Comments
 (0)