Skip to content

Commit

Permalink
test(datacatalog): run unit tests with Python 3.8 (#10014)
Browse files Browse the repository at this point in the history
Also, update doc strings for taxonomy classes.
  • Loading branch information
yoshi-automation authored and tswast committed Jan 23, 2020
1 parent c61c238 commit a51da49
Show file tree
Hide file tree
Showing 12 changed files with 3,738 additions and 142 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1563,18 +1563,20 @@ def update_tag_template_field(
If a dict is provided, it must be of the same form as the protobuf
message :class:`~google.cloud.datacatalog_v1beta1.types.TagTemplateField`
update_mask (Union[dict, ~google.cloud.datacatalog_v1beta1.types.FieldMask]): The field mask specifies the parts of the template to be updated.
Allowed fields:
update_mask (Union[dict, ~google.cloud.datacatalog_v1beta1.types.FieldMask]): Optional. The field mask specifies the parts of the template to be
updated. Allowed fields:
- ``display_name``
- ``type.enum_type``
- ``is_required``
If ``update_mask`` is not set or empty, all of the allowed fields above
will be updated.
When updating an enum type, the provided values will be merged with the
existing values. Therefore, enum values can only be added, existing enum
values cannot be deleted nor renamed.
values cannot be deleted nor renamed. Updating a template field from
optional to required is NOT allowed.
If a dict is provided, it must be of the same form as the protobuf
message :class:`~google.cloud.datacatalog_v1beta1.types.FieldMask`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@

class PolicyTagManagerClient(object):
"""
Policy tag manager API service allows clients to manage their taxonomies and
policy tags data.
The policy tag manager API service allows clients to manage their taxonomies
and policy tags.
"""

SERVICE_ADDRESS = "datacatalog.googleapis.com:443"
Expand Down Expand Up @@ -205,7 +205,7 @@ def create_taxonomy(
metadata=None,
):
"""
Creates a new taxonomy in a given project.
Creates a taxonomy in the specified project.
Example:
>>> from google.cloud import datacatalog_v1beta1
Expand All @@ -215,10 +215,8 @@ def create_taxonomy(
>>> response = client.create_taxonomy()
Args:
parent (str): Required. Resource name of the project that the newly created taxonomy
belongs to.
taxonomy (Union[dict, ~google.cloud.datacatalog_v1beta1.types.Taxonomy]): The taxonomy to be created. The name field must be left blank. The
display\_name field is mandatory.
parent (str): Required. Resource name of the project that the taxonomy will belong to.
taxonomy (Union[dict, ~google.cloud.datacatalog_v1beta1.types.Taxonomy]): The taxonomy to be created.
If a dict is provided, it must be of the same form as the protobuf
message :class:`~google.cloud.datacatalog_v1beta1.types.Taxonomy`
Expand Down Expand Up @@ -281,7 +279,7 @@ def delete_taxonomy(
):
"""
Deletes a taxonomy. This operation will also delete all
policy tags in this taxonomy.
policy tags in this taxonomy along with their associated policies.
Example:
>>> from google.cloud import datacatalog_v1beta1
Expand Down Expand Up @@ -429,7 +427,8 @@ def list_taxonomies(
metadata=None,
):
"""
Lists all taxonomies in a project in a particular location.
Lists all taxonomies in a project in a particular location that the caller
has permission to view.
Example:
>>> from google.cloud import datacatalog_v1beta1
Expand All @@ -439,8 +438,9 @@ def list_taxonomies(
>>> response = client.list_taxonomies()
Args:
parent (str): Required. Resource name of a project to list the taxonomies of.
page_size (int): The maximum number of items to return. If not set, defaults to 50.
parent (str): Required. Resource name of the project to list the taxonomies of.
page_size (int): The maximum number of items to return. Must be a value between 1 and 1000.
If not set, defaults to 50.
page_token (str): The next\_page\_token value returned from a previous list request, if
any. If not set, defaults to an empty string.
retry (Optional[google.api_core.retry.Retry]): A retry object used
Expand Down Expand Up @@ -511,7 +511,7 @@ def get_taxonomy(
>>> response = client.get_taxonomy()
Args:
name (str): Required. Resource name of the taxonomy to be returned.
name (str): Required. Resource name of the requested taxonomy.
retry (Optional[google.api_core.retry.Retry]): A retry object used
to retry requests. If ``None`` is specified, requests will
be retried using a default configuration.
Expand Down Expand Up @@ -569,7 +569,7 @@ def create_policy_tag(
metadata=None,
):
"""
Creates a policy tag in a taxonomy.
Creates a policy tag in the specified taxonomy.
Example:
>>> from google.cloud import datacatalog_v1beta1
Expand All @@ -579,11 +579,8 @@ def create_policy_tag(
>>> response = client.create_policy_tag()
Args:
parent (str): Required. Resource name of the taxonomy that the newly created policy tag
belongs to.
policy_tag (Union[dict, ~google.cloud.datacatalog_v1beta1.types.PolicyTag]): The policy tag to be created. The name, and taxonomy\_display\_name
field must be left blank. The display\_name field is mandatory and must
not be duplicated with existing policy tags in the same taxonomy.
parent (str): Required. Resource name of the taxonomy that the policy tag will belong to.
policy_tag (Union[dict, ~google.cloud.datacatalog_v1beta1.types.PolicyTag]): The policy tag to be created.
If a dict is provided, it must be of the same form as the protobuf
message :class:`~google.cloud.datacatalog_v1beta1.types.PolicyTag`
Expand Down Expand Up @@ -655,7 +652,7 @@ def delete_policy_tag(
>>> client.delete_policy_tag()
Args:
name (str): Required. Resource name of the policy tag to be deleted. All its descendant
name (str): Required. Resource name of the policy tag to be deleted. All of its descendant
policy tags will also be deleted.
retry (Optional[google.api_core.retry.Retry]): A retry object used
to retry requests. If ``None`` is specified, requests will
Expand Down Expand Up @@ -806,8 +803,9 @@ def list_policy_tags(
>>> response = client.list_policy_tags()
Args:
parent (str): Required. Resource name of a taxonomy to list the policy tags of.
page_size (int): The maximum number of items to return. If not set, defaults to 50.
parent (str): Required. Resource name of the taxonomy to list the policy tags of.
page_size (int): The maximum number of items to return. Must be a value between 1 and 1000.
If not set, defaults to 50.
page_token (str): The next\_page\_token value returned from a previous List request, if
any. If not set, defaults to an empty string.
retry (Optional[google.api_core.retry.Retry]): A retry object used
Expand Down Expand Up @@ -878,7 +876,7 @@ def get_policy_tag(
>>> response = client.get_policy_tag()
Args:
name (str): Required. Resource name of the policy tag to be returned.
name (str): Required. Resource name of the requested policy tag.
retry (Optional[google.api_core.retry.Retry]): A retry object used
to retry requests. If ``None`` is specified, requests will
be retried using a default configuration.
Expand Down Expand Up @@ -1088,7 +1086,8 @@ def test_iam_permissions(
metadata=None,
):
"""
Returns permissions that a caller has on specified resources.
Returns the permissions that a caller has on the specified taxonomy or
policy tag.
Example:
>>> from google.cloud import datacatalog_v1beta1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ def channel(self):
def create_taxonomy(self):
"""Return the gRPC stub for :meth:`PolicyTagManagerClient.create_taxonomy`.
Creates a new taxonomy in a given project.
Creates a taxonomy in the specified project.
Returns:
Callable: A callable which accepts the appropriate
Expand All @@ -127,7 +127,7 @@ def delete_taxonomy(self):
"""Return the gRPC stub for :meth:`PolicyTagManagerClient.delete_taxonomy`.
Deletes a taxonomy. This operation will also delete all
policy tags in this taxonomy.
policy tags in this taxonomy along with their associated policies.
Returns:
Callable: A callable which accepts the appropriate
Expand All @@ -153,7 +153,8 @@ def update_taxonomy(self):
def list_taxonomies(self):
"""Return the gRPC stub for :meth:`PolicyTagManagerClient.list_taxonomies`.
Lists all taxonomies in a project in a particular location.
Lists all taxonomies in a project in a particular location that the caller
has permission to view.
Returns:
Callable: A callable which accepts the appropriate
Expand All @@ -179,7 +180,7 @@ def get_taxonomy(self):
def create_policy_tag(self):
"""Return the gRPC stub for :meth:`PolicyTagManagerClient.create_policy_tag`.
Creates a policy tag in a taxonomy.
Creates a policy tag in the specified taxonomy.
Returns:
Callable: A callable which accepts the appropriate
Expand Down Expand Up @@ -270,7 +271,8 @@ def set_iam_policy(self):
def test_iam_permissions(self):
"""Return the gRPC stub for :meth:`PolicyTagManagerClient.test_iam_permissions`.
Returns permissions that a caller has on specified resources.
Returns the permissions that a caller has on the specified taxonomy or
policy tag.
Returns:
Callable: A callable which accepts the appropriate
Expand Down
Loading

0 comments on commit a51da49

Please sign in to comment.