Skip to content

Commit 2ee7272

Browse files
yoshi-automationtswast
authored andcommitted
test(datacatalog): run unit tests with Python 3.8 (#10014)
Also, update doc strings for taxonomy classes.
1 parent 09a79d0 commit 2ee7272

12 files changed

+3738
-142
lines changed

google/cloud/datacatalog_v1beta1/gapic/data_catalog_client.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1563,18 +1563,20 @@ def update_tag_template_field(
15631563
15641564
If a dict is provided, it must be of the same form as the protobuf
15651565
message :class:`~google.cloud.datacatalog_v1beta1.types.TagTemplateField`
1566-
update_mask (Union[dict, ~google.cloud.datacatalog_v1beta1.types.FieldMask]): The field mask specifies the parts of the template to be updated.
1567-
Allowed fields:
1566+
update_mask (Union[dict, ~google.cloud.datacatalog_v1beta1.types.FieldMask]): Optional. The field mask specifies the parts of the template to be
1567+
updated. Allowed fields:
15681568
15691569
- ``display_name``
15701570
- ``type.enum_type``
1571+
- ``is_required``
15711572
15721573
If ``update_mask`` is not set or empty, all of the allowed fields above
15731574
will be updated.
15741575
15751576
When updating an enum type, the provided values will be merged with the
15761577
existing values. Therefore, enum values can only be added, existing enum
1577-
values cannot be deleted nor renamed.
1578+
values cannot be deleted nor renamed. Updating a template field from
1579+
optional to required is NOT allowed.
15781580
15791581
If a dict is provided, it must be of the same form as the protobuf
15801582
message :class:`~google.cloud.datacatalog_v1beta1.types.FieldMask`

google/cloud/datacatalog_v1beta1/gapic/policy_tag_manager_client.py

Lines changed: 22 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@
5252

5353
class PolicyTagManagerClient(object):
5454
"""
55-
Policy tag manager API service allows clients to manage their taxonomies and
56-
policy tags data.
55+
The policy tag manager API service allows clients to manage their taxonomies
56+
and policy tags.
5757
"""
5858

5959
SERVICE_ADDRESS = "datacatalog.googleapis.com:443"
@@ -205,7 +205,7 @@ def create_taxonomy(
205205
metadata=None,
206206
):
207207
"""
208-
Creates a new taxonomy in a given project.
208+
Creates a taxonomy in the specified project.
209209
210210
Example:
211211
>>> from google.cloud import datacatalog_v1beta1
@@ -215,10 +215,8 @@ def create_taxonomy(
215215
>>> response = client.create_taxonomy()
216216
217217
Args:
218-
parent (str): Required. Resource name of the project that the newly created taxonomy
219-
belongs to.
220-
taxonomy (Union[dict, ~google.cloud.datacatalog_v1beta1.types.Taxonomy]): The taxonomy to be created. The name field must be left blank. The
221-
display\_name field is mandatory.
218+
parent (str): Required. Resource name of the project that the taxonomy will belong to.
219+
taxonomy (Union[dict, ~google.cloud.datacatalog_v1beta1.types.Taxonomy]): The taxonomy to be created.
222220
223221
If a dict is provided, it must be of the same form as the protobuf
224222
message :class:`~google.cloud.datacatalog_v1beta1.types.Taxonomy`
@@ -281,7 +279,7 @@ def delete_taxonomy(
281279
):
282280
"""
283281
Deletes a taxonomy. This operation will also delete all
284-
policy tags in this taxonomy.
282+
policy tags in this taxonomy along with their associated policies.
285283
286284
Example:
287285
>>> from google.cloud import datacatalog_v1beta1
@@ -429,7 +427,8 @@ def list_taxonomies(
429427
metadata=None,
430428
):
431429
"""
432-
Lists all taxonomies in a project in a particular location.
430+
Lists all taxonomies in a project in a particular location that the caller
431+
has permission to view.
433432
434433
Example:
435434
>>> from google.cloud import datacatalog_v1beta1
@@ -439,8 +438,9 @@ def list_taxonomies(
439438
>>> response = client.list_taxonomies()
440439
441440
Args:
442-
parent (str): Required. Resource name of a project to list the taxonomies of.
443-
page_size (int): The maximum number of items to return. If not set, defaults to 50.
441+
parent (str): Required. Resource name of the project to list the taxonomies of.
442+
page_size (int): The maximum number of items to return. Must be a value between 1 and 1000.
443+
If not set, defaults to 50.
444444
page_token (str): The next\_page\_token value returned from a previous list request, if
445445
any. If not set, defaults to an empty string.
446446
retry (Optional[google.api_core.retry.Retry]): A retry object used
@@ -511,7 +511,7 @@ def get_taxonomy(
511511
>>> response = client.get_taxonomy()
512512
513513
Args:
514-
name (str): Required. Resource name of the taxonomy to be returned.
514+
name (str): Required. Resource name of the requested taxonomy.
515515
retry (Optional[google.api_core.retry.Retry]): A retry object used
516516
to retry requests. If ``None`` is specified, requests will
517517
be retried using a default configuration.
@@ -569,7 +569,7 @@ def create_policy_tag(
569569
metadata=None,
570570
):
571571
"""
572-
Creates a policy tag in a taxonomy.
572+
Creates a policy tag in the specified taxonomy.
573573
574574
Example:
575575
>>> from google.cloud import datacatalog_v1beta1
@@ -579,11 +579,8 @@ def create_policy_tag(
579579
>>> response = client.create_policy_tag()
580580
581581
Args:
582-
parent (str): Required. Resource name of the taxonomy that the newly created policy tag
583-
belongs to.
584-
policy_tag (Union[dict, ~google.cloud.datacatalog_v1beta1.types.PolicyTag]): The policy tag to be created. The name, and taxonomy\_display\_name
585-
field must be left blank. The display\_name field is mandatory and must
586-
not be duplicated with existing policy tags in the same taxonomy.
582+
parent (str): Required. Resource name of the taxonomy that the policy tag will belong to.
583+
policy_tag (Union[dict, ~google.cloud.datacatalog_v1beta1.types.PolicyTag]): The policy tag to be created.
587584
588585
If a dict is provided, it must be of the same form as the protobuf
589586
message :class:`~google.cloud.datacatalog_v1beta1.types.PolicyTag`
@@ -655,7 +652,7 @@ def delete_policy_tag(
655652
>>> client.delete_policy_tag()
656653
657654
Args:
658-
name (str): Required. Resource name of the policy tag to be deleted. All its descendant
655+
name (str): Required. Resource name of the policy tag to be deleted. All of its descendant
659656
policy tags will also be deleted.
660657
retry (Optional[google.api_core.retry.Retry]): A retry object used
661658
to retry requests. If ``None`` is specified, requests will
@@ -806,8 +803,9 @@ def list_policy_tags(
806803
>>> response = client.list_policy_tags()
807804
808805
Args:
809-
parent (str): Required. Resource name of a taxonomy to list the policy tags of.
810-
page_size (int): The maximum number of items to return. If not set, defaults to 50.
806+
parent (str): Required. Resource name of the taxonomy to list the policy tags of.
807+
page_size (int): The maximum number of items to return. Must be a value between 1 and 1000.
808+
If not set, defaults to 50.
811809
page_token (str): The next\_page\_token value returned from a previous List request, if
812810
any. If not set, defaults to an empty string.
813811
retry (Optional[google.api_core.retry.Retry]): A retry object used
@@ -878,7 +876,7 @@ def get_policy_tag(
878876
>>> response = client.get_policy_tag()
879877
880878
Args:
881-
name (str): Required. Resource name of the policy tag to be returned.
879+
name (str): Required. Resource name of the requested policy tag.
882880
retry (Optional[google.api_core.retry.Retry]): A retry object used
883881
to retry requests. If ``None`` is specified, requests will
884882
be retried using a default configuration.
@@ -1088,7 +1086,8 @@ def test_iam_permissions(
10881086
metadata=None,
10891087
):
10901088
"""
1091-
Returns permissions that a caller has on specified resources.
1089+
Returns the permissions that a caller has on the specified taxonomy or
1090+
policy tag.
10921091
10931092
Example:
10941093
>>> from google.cloud import datacatalog_v1beta1

google/cloud/datacatalog_v1beta1/gapic/transports/policy_tag_manager_grpc_transport.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ def channel(self):
113113
def create_taxonomy(self):
114114
"""Return the gRPC stub for :meth:`PolicyTagManagerClient.create_taxonomy`.
115115
116-
Creates a new taxonomy in a given project.
116+
Creates a taxonomy in the specified project.
117117
118118
Returns:
119119
Callable: A callable which accepts the appropriate
@@ -127,7 +127,7 @@ def delete_taxonomy(self):
127127
"""Return the gRPC stub for :meth:`PolicyTagManagerClient.delete_taxonomy`.
128128
129129
Deletes a taxonomy. This operation will also delete all
130-
policy tags in this taxonomy.
130+
policy tags in this taxonomy along with their associated policies.
131131
132132
Returns:
133133
Callable: A callable which accepts the appropriate
@@ -153,7 +153,8 @@ def update_taxonomy(self):
153153
def list_taxonomies(self):
154154
"""Return the gRPC stub for :meth:`PolicyTagManagerClient.list_taxonomies`.
155155
156-
Lists all taxonomies in a project in a particular location.
156+
Lists all taxonomies in a project in a particular location that the caller
157+
has permission to view.
157158
158159
Returns:
159160
Callable: A callable which accepts the appropriate
@@ -179,7 +180,7 @@ def get_taxonomy(self):
179180
def create_policy_tag(self):
180181
"""Return the gRPC stub for :meth:`PolicyTagManagerClient.create_policy_tag`.
181182
182-
Creates a policy tag in a taxonomy.
183+
Creates a policy tag in the specified taxonomy.
183184
184185
Returns:
185186
Callable: A callable which accepts the appropriate
@@ -270,7 +271,8 @@ def set_iam_policy(self):
270271
def test_iam_permissions(self):
271272
"""Return the gRPC stub for :meth:`PolicyTagManagerClient.test_iam_permissions`.
272273
273-
Returns permissions that a caller has on specified resources.
274+
Returns the permissions that a caller has on the specified taxonomy or
275+
policy tag.
274276
275277
Returns:
276278
Callable: A callable which accepts the appropriate

0 commit comments

Comments
 (0)