Skip to content
This repository has been archived by the owner on Sep 5, 2023. It is now read-only.

Commit

Permalink
chore: Use gapic-generator-python 0.65.0 (#298)
Browse files Browse the repository at this point in the history
- [ ] Regenerate this pull request now.

PiperOrigin-RevId: 440970084

Source-Link: googleapis/googleapis@5e0a3d5

Source-Link: googleapis/googleapis-gen@b0c628a
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYjBjNjI4YTNmYWRlNzY4ZjIyNWQ3Njk5Mjc5MWVhMWJhMmE4ODFiZSJ9

docs: fix type in docstring for map fields
  • Loading branch information
gcf-owl-bot[bot] committed Apr 13, 2022
1 parent ac63ed7 commit 41c28cd
Show file tree
Hide file tree
Showing 12 changed files with 172 additions and 104 deletions.
24 changes: 7 additions & 17 deletions google/cloud/language_v1/services/language_service/async_client.py
Expand Up @@ -16,7 +16,7 @@
from collections import OrderedDict
import functools
import re
from typing import Dict, Optional, Sequence, Tuple, Type, Union
from typing import Dict, Mapping, Optional, Sequence, Tuple, Type, Union
import pkg_resources

from google.api_core.client_options import ClientOptions
Expand Down Expand Up @@ -291,8 +291,7 @@ def sample_analyze_sentiment():
maximum=60.0,
multiplier=1.3,
predicate=retries.if_exception_type(
core_exceptions.DeadlineExceeded,
core_exceptions.ServiceUnavailable,
core_exceptions.GoogleAPICallError,
),
deadline=600.0,
),
Expand Down Expand Up @@ -326,7 +325,6 @@ async def analyze_entities(
salience, mentions for each entity, and other
properties.
.. code-block:: python
from google.cloud import language_v1
Expand Down Expand Up @@ -402,8 +400,7 @@ def sample_analyze_entities():
maximum=60.0,
multiplier=1.3,
predicate=retries.if_exception_type(
core_exceptions.DeadlineExceeded,
core_exceptions.ServiceUnavailable,
core_exceptions.GoogleAPICallError,
),
deadline=600.0,
),
Expand Down Expand Up @@ -437,7 +434,6 @@ async def analyze_entity_sentiment(
in the text and analyzes sentiment associated with each entity
and its mentions.
.. code-block:: python
from google.cloud import language_v1
Expand Down Expand Up @@ -516,8 +512,7 @@ def sample_analyze_entity_sentiment():
maximum=60.0,
multiplier=1.3,
predicate=retries.if_exception_type(
core_exceptions.DeadlineExceeded,
core_exceptions.ServiceUnavailable,
core_exceptions.GoogleAPICallError,
),
deadline=600.0,
),
Expand Down Expand Up @@ -550,7 +545,6 @@ async def analyze_syntax(
boundaries and tokenization along with part of speech
tags, dependency trees, and other properties.
.. code-block:: python
from google.cloud import language_v1
Expand Down Expand Up @@ -626,8 +620,7 @@ def sample_analyze_syntax():
maximum=60.0,
multiplier=1.3,
predicate=retries.if_exception_type(
core_exceptions.DeadlineExceeded,
core_exceptions.ServiceUnavailable,
core_exceptions.GoogleAPICallError,
),
deadline=600.0,
),
Expand Down Expand Up @@ -726,8 +719,7 @@ def sample_classify_text():
maximum=60.0,
multiplier=1.3,
predicate=retries.if_exception_type(
core_exceptions.DeadlineExceeded,
core_exceptions.ServiceUnavailable,
core_exceptions.GoogleAPICallError,
),
deadline=600.0,
),
Expand Down Expand Up @@ -761,7 +753,6 @@ async def annotate_text(
that analyzeSentiment, analyzeEntities, and
analyzeSyntax provide in one call.
.. code-block:: python
from google.cloud import language_v1
Expand Down Expand Up @@ -848,8 +839,7 @@ def sample_annotate_text():
maximum=60.0,
multiplier=1.3,
predicate=retries.if_exception_type(
core_exceptions.DeadlineExceeded,
core_exceptions.ServiceUnavailable,
core_exceptions.GoogleAPICallError,
),
deadline=600.0,
),
Expand Down
6 changes: 1 addition & 5 deletions google/cloud/language_v1/services/language_service/client.py
Expand Up @@ -16,7 +16,7 @@
from collections import OrderedDict
import os
import re
from typing import Dict, Optional, Sequence, Tuple, Type, Union
from typing import Dict, Mapping, Optional, Sequence, Tuple, Type, Union
import pkg_resources

from google.api_core import client_options as client_options_lib
Expand Down Expand Up @@ -520,7 +520,6 @@ def analyze_entities(
salience, mentions for each entity, and other
properties.
.. code-block:: python
from google.cloud import language_v1
Expand Down Expand Up @@ -621,7 +620,6 @@ def analyze_entity_sentiment(
in the text and analyzes sentiment associated with each entity
and its mentions.
.. code-block:: python
from google.cloud import language_v1
Expand Down Expand Up @@ -724,7 +722,6 @@ def analyze_syntax(
boundaries and tokenization along with part of speech
tags, dependency trees, and other properties.
.. code-block:: python
from google.cloud import language_v1
Expand Down Expand Up @@ -915,7 +912,6 @@ def annotate_text(
that analyzeSentiment, analyzeEntities, and
analyzeSyntax provide in one call.
.. code-block:: python
from google.cloud import language_v1
Expand Down
Expand Up @@ -83,6 +83,7 @@ def __init__(
always_use_jwt_access (Optional[bool]): Whether self signed JWT should
be used for service account credentials.
"""

# Save the hostname. Default to port 443 (HTTPS) if none is specified.
if ":" not in host:
host += ":443"
Expand Down Expand Up @@ -130,8 +131,7 @@ def _prep_wrapped_messages(self, client_info):
maximum=60.0,
multiplier=1.3,
predicate=retries.if_exception_type(
core_exceptions.DeadlineExceeded,
core_exceptions.ServiceUnavailable,
core_exceptions.GoogleAPICallError,
),
deadline=600.0,
),
Expand All @@ -145,8 +145,7 @@ def _prep_wrapped_messages(self, client_info):
maximum=60.0,
multiplier=1.3,
predicate=retries.if_exception_type(
core_exceptions.DeadlineExceeded,
core_exceptions.ServiceUnavailable,
core_exceptions.GoogleAPICallError,
),
deadline=600.0,
),
Expand All @@ -160,8 +159,7 @@ def _prep_wrapped_messages(self, client_info):
maximum=60.0,
multiplier=1.3,
predicate=retries.if_exception_type(
core_exceptions.DeadlineExceeded,
core_exceptions.ServiceUnavailable,
core_exceptions.GoogleAPICallError,
),
deadline=600.0,
),
Expand All @@ -175,8 +173,7 @@ def _prep_wrapped_messages(self, client_info):
maximum=60.0,
multiplier=1.3,
predicate=retries.if_exception_type(
core_exceptions.DeadlineExceeded,
core_exceptions.ServiceUnavailable,
core_exceptions.GoogleAPICallError,
),
deadline=600.0,
),
Expand All @@ -190,8 +187,7 @@ def _prep_wrapped_messages(self, client_info):
maximum=60.0,
multiplier=1.3,
predicate=retries.if_exception_type(
core_exceptions.DeadlineExceeded,
core_exceptions.ServiceUnavailable,
core_exceptions.GoogleAPICallError,
),
deadline=600.0,
),
Expand All @@ -205,8 +201,7 @@ def _prep_wrapped_messages(self, client_info):
maximum=60.0,
multiplier=1.3,
predicate=retries.if_exception_type(
core_exceptions.DeadlineExceeded,
core_exceptions.ServiceUnavailable,
core_exceptions.GoogleAPICallError,
),
deadline=600.0,
),
Expand Down Expand Up @@ -296,5 +291,9 @@ def annotate_text(
]:
raise NotImplementedError()

@property
def kind(self) -> str:
raise NotImplementedError()


__all__ = ("LanguageServiceTransport",)
Expand Up @@ -412,5 +412,9 @@ def annotate_text(
def close(self):
self.grpc_channel.close()

@property
def kind(self) -> str:
return "grpc"


__all__ = ("LanguageServiceGrpcTransport",)
2 changes: 1 addition & 1 deletion google/cloud/language_v1/types/language_service.py
Expand Up @@ -160,7 +160,7 @@ class Entity(proto.Message):
The representative name for the entity.
type_ (google.cloud.language_v1.types.Entity.Type):
The entity type.
metadata (Sequence[google.cloud.language_v1.types.Entity.MetadataEntry]):
metadata (Mapping[str, str]):
Metadata associated with the entity.
For most entity types, the metadata is a Wikipedia URL
Expand Down
Expand Up @@ -16,7 +16,7 @@
from collections import OrderedDict
import functools
import re
from typing import Dict, Optional, Sequence, Tuple, Type, Union
from typing import Dict, Mapping, Optional, Sequence, Tuple, Type, Union
import pkg_resources

from google.api_core.client_options import ClientOptions
Expand Down Expand Up @@ -292,8 +292,7 @@ def sample_analyze_sentiment():
maximum=60.0,
multiplier=1.3,
predicate=retries.if_exception_type(
core_exceptions.DeadlineExceeded,
core_exceptions.ServiceUnavailable,
core_exceptions.GoogleAPICallError,
),
deadline=600.0,
),
Expand Down Expand Up @@ -327,7 +326,6 @@ async def analyze_entities(
salience, mentions for each entity, and other
properties.
.. code-block:: python
from google.cloud import language_v1beta2
Expand Down Expand Up @@ -403,8 +401,7 @@ def sample_analyze_entities():
maximum=60.0,
multiplier=1.3,
predicate=retries.if_exception_type(
core_exceptions.DeadlineExceeded,
core_exceptions.ServiceUnavailable,
core_exceptions.GoogleAPICallError,
),
deadline=600.0,
),
Expand Down Expand Up @@ -438,7 +435,6 @@ async def analyze_entity_sentiment(
in the text and analyzes sentiment associated with each entity
and its mentions.
.. code-block:: python
from google.cloud import language_v1beta2
Expand Down Expand Up @@ -517,8 +513,7 @@ def sample_analyze_entity_sentiment():
maximum=60.0,
multiplier=1.3,
predicate=retries.if_exception_type(
core_exceptions.DeadlineExceeded,
core_exceptions.ServiceUnavailable,
core_exceptions.GoogleAPICallError,
),
deadline=600.0,
),
Expand Down Expand Up @@ -551,7 +546,6 @@ async def analyze_syntax(
boundaries and tokenization along with part-of-speech
tags, dependency trees, and other properties.
.. code-block:: python
from google.cloud import language_v1beta2
Expand Down Expand Up @@ -627,8 +621,7 @@ def sample_analyze_syntax():
maximum=60.0,
multiplier=1.3,
predicate=retries.if_exception_type(
core_exceptions.DeadlineExceeded,
core_exceptions.ServiceUnavailable,
core_exceptions.GoogleAPICallError,
),
deadline=600.0,
),
Expand Down Expand Up @@ -727,8 +720,7 @@ def sample_classify_text():
maximum=60.0,
multiplier=1.3,
predicate=retries.if_exception_type(
core_exceptions.DeadlineExceeded,
core_exceptions.ServiceUnavailable,
core_exceptions.GoogleAPICallError,
),
deadline=600.0,
),
Expand Down Expand Up @@ -762,7 +754,6 @@ async def annotate_text(
sentiment, entity, and classification features in one
call.
.. code-block:: python
from google.cloud import language_v1beta2
Expand Down Expand Up @@ -849,8 +840,7 @@ def sample_annotate_text():
maximum=60.0,
multiplier=1.3,
predicate=retries.if_exception_type(
core_exceptions.DeadlineExceeded,
core_exceptions.ServiceUnavailable,
core_exceptions.GoogleAPICallError,
),
deadline=600.0,
),
Expand Down
Expand Up @@ -16,7 +16,7 @@
from collections import OrderedDict
import os
import re
from typing import Dict, Optional, Sequence, Tuple, Type, Union
from typing import Dict, Mapping, Optional, Sequence, Tuple, Type, Union
import pkg_resources

from google.api_core import client_options as client_options_lib
Expand Down Expand Up @@ -521,7 +521,6 @@ def analyze_entities(
salience, mentions for each entity, and other
properties.
.. code-block:: python
from google.cloud import language_v1beta2
Expand Down Expand Up @@ -622,7 +621,6 @@ def analyze_entity_sentiment(
in the text and analyzes sentiment associated with each entity
and its mentions.
.. code-block:: python
from google.cloud import language_v1beta2
Expand Down Expand Up @@ -725,7 +723,6 @@ def analyze_syntax(
boundaries and tokenization along with part-of-speech
tags, dependency trees, and other properties.
.. code-block:: python
from google.cloud import language_v1beta2
Expand Down Expand Up @@ -916,7 +913,6 @@ def annotate_text(
sentiment, entity, and classification features in one
call.
.. code-block:: python
from google.cloud import language_v1beta2
Expand Down

0 comments on commit 41c28cd

Please sign in to comment.