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

Commit 41c28cd

Browse files
chore: Use gapic-generator-python 0.65.0 (#298)
- [ ] Regenerate this pull request now. PiperOrigin-RevId: 440970084 Source-Link: googleapis/googleapis@5e0a3d5 Source-Link: https://github.com/googleapis/googleapis-gen/commit/b0c628a3fade768f225d76992791ea1ba2a881be Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYjBjNjI4YTNmYWRlNzY4ZjIyNWQ3Njk5Mjc5MWVhMWJhMmE4ODFiZSJ9 docs: fix type in docstring for map fields
1 parent ac63ed7 commit 41c28cd

File tree

12 files changed

+172
-104
lines changed

12 files changed

+172
-104
lines changed

google/cloud/language_v1/services/language_service/async_client.py

Lines changed: 7 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
from collections import OrderedDict
1717
import functools
1818
import re
19-
from typing import Dict, Optional, Sequence, Tuple, Type, Union
19+
from typing import Dict, Mapping, Optional, Sequence, Tuple, Type, Union
2020
import pkg_resources
2121

2222
from google.api_core.client_options import ClientOptions
@@ -291,8 +291,7 @@ def sample_analyze_sentiment():
291291
maximum=60.0,
292292
multiplier=1.3,
293293
predicate=retries.if_exception_type(
294-
core_exceptions.DeadlineExceeded,
295-
core_exceptions.ServiceUnavailable,
294+
core_exceptions.GoogleAPICallError,
296295
),
297296
deadline=600.0,
298297
),
@@ -326,7 +325,6 @@ async def analyze_entities(
326325
salience, mentions for each entity, and other
327326
properties.
328327
329-
330328
.. code-block:: python
331329
332330
from google.cloud import language_v1
@@ -402,8 +400,7 @@ def sample_analyze_entities():
402400
maximum=60.0,
403401
multiplier=1.3,
404402
predicate=retries.if_exception_type(
405-
core_exceptions.DeadlineExceeded,
406-
core_exceptions.ServiceUnavailable,
403+
core_exceptions.GoogleAPICallError,
407404
),
408405
deadline=600.0,
409406
),
@@ -437,7 +434,6 @@ async def analyze_entity_sentiment(
437434
in the text and analyzes sentiment associated with each entity
438435
and its mentions.
439436
440-
441437
.. code-block:: python
442438
443439
from google.cloud import language_v1
@@ -516,8 +512,7 @@ def sample_analyze_entity_sentiment():
516512
maximum=60.0,
517513
multiplier=1.3,
518514
predicate=retries.if_exception_type(
519-
core_exceptions.DeadlineExceeded,
520-
core_exceptions.ServiceUnavailable,
515+
core_exceptions.GoogleAPICallError,
521516
),
522517
deadline=600.0,
523518
),
@@ -550,7 +545,6 @@ async def analyze_syntax(
550545
boundaries and tokenization along with part of speech
551546
tags, dependency trees, and other properties.
552547
553-
554548
.. code-block:: python
555549
556550
from google.cloud import language_v1
@@ -626,8 +620,7 @@ def sample_analyze_syntax():
626620
maximum=60.0,
627621
multiplier=1.3,
628622
predicate=retries.if_exception_type(
629-
core_exceptions.DeadlineExceeded,
630-
core_exceptions.ServiceUnavailable,
623+
core_exceptions.GoogleAPICallError,
631624
),
632625
deadline=600.0,
633626
),
@@ -726,8 +719,7 @@ def sample_classify_text():
726719
maximum=60.0,
727720
multiplier=1.3,
728721
predicate=retries.if_exception_type(
729-
core_exceptions.DeadlineExceeded,
730-
core_exceptions.ServiceUnavailable,
722+
core_exceptions.GoogleAPICallError,
731723
),
732724
deadline=600.0,
733725
),
@@ -761,7 +753,6 @@ async def annotate_text(
761753
that analyzeSentiment, analyzeEntities, and
762754
analyzeSyntax provide in one call.
763755
764-
765756
.. code-block:: python
766757
767758
from google.cloud import language_v1
@@ -848,8 +839,7 @@ def sample_annotate_text():
848839
maximum=60.0,
849840
multiplier=1.3,
850841
predicate=retries.if_exception_type(
851-
core_exceptions.DeadlineExceeded,
852-
core_exceptions.ServiceUnavailable,
842+
core_exceptions.GoogleAPICallError,
853843
),
854844
deadline=600.0,
855845
),

google/cloud/language_v1/services/language_service/client.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
from collections import OrderedDict
1717
import os
1818
import re
19-
from typing import Dict, Optional, Sequence, Tuple, Type, Union
19+
from typing import Dict, Mapping, Optional, Sequence, Tuple, Type, Union
2020
import pkg_resources
2121

2222
from google.api_core import client_options as client_options_lib
@@ -520,7 +520,6 @@ def analyze_entities(
520520
salience, mentions for each entity, and other
521521
properties.
522522
523-
524523
.. code-block:: python
525524
526525
from google.cloud import language_v1
@@ -621,7 +620,6 @@ def analyze_entity_sentiment(
621620
in the text and analyzes sentiment associated with each entity
622621
and its mentions.
623622
624-
625623
.. code-block:: python
626624
627625
from google.cloud import language_v1
@@ -724,7 +722,6 @@ def analyze_syntax(
724722
boundaries and tokenization along with part of speech
725723
tags, dependency trees, and other properties.
726724
727-
728725
.. code-block:: python
729726
730727
from google.cloud import language_v1
@@ -915,7 +912,6 @@ def annotate_text(
915912
that analyzeSentiment, analyzeEntities, and
916913
analyzeSyntax provide in one call.
917914
918-
919915
.. code-block:: python
920916
921917
from google.cloud import language_v1

google/cloud/language_v1/services/language_service/transports/base.py

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ def __init__(
8383
always_use_jwt_access (Optional[bool]): Whether self signed JWT should
8484
be used for service account credentials.
8585
"""
86+
8687
# Save the hostname. Default to port 443 (HTTPS) if none is specified.
8788
if ":" not in host:
8889
host += ":443"
@@ -130,8 +131,7 @@ def _prep_wrapped_messages(self, client_info):
130131
maximum=60.0,
131132
multiplier=1.3,
132133
predicate=retries.if_exception_type(
133-
core_exceptions.DeadlineExceeded,
134-
core_exceptions.ServiceUnavailable,
134+
core_exceptions.GoogleAPICallError,
135135
),
136136
deadline=600.0,
137137
),
@@ -145,8 +145,7 @@ def _prep_wrapped_messages(self, client_info):
145145
maximum=60.0,
146146
multiplier=1.3,
147147
predicate=retries.if_exception_type(
148-
core_exceptions.DeadlineExceeded,
149-
core_exceptions.ServiceUnavailable,
148+
core_exceptions.GoogleAPICallError,
150149
),
151150
deadline=600.0,
152151
),
@@ -160,8 +159,7 @@ def _prep_wrapped_messages(self, client_info):
160159
maximum=60.0,
161160
multiplier=1.3,
162161
predicate=retries.if_exception_type(
163-
core_exceptions.DeadlineExceeded,
164-
core_exceptions.ServiceUnavailable,
162+
core_exceptions.GoogleAPICallError,
165163
),
166164
deadline=600.0,
167165
),
@@ -175,8 +173,7 @@ def _prep_wrapped_messages(self, client_info):
175173
maximum=60.0,
176174
multiplier=1.3,
177175
predicate=retries.if_exception_type(
178-
core_exceptions.DeadlineExceeded,
179-
core_exceptions.ServiceUnavailable,
176+
core_exceptions.GoogleAPICallError,
180177
),
181178
deadline=600.0,
182179
),
@@ -190,8 +187,7 @@ def _prep_wrapped_messages(self, client_info):
190187
maximum=60.0,
191188
multiplier=1.3,
192189
predicate=retries.if_exception_type(
193-
core_exceptions.DeadlineExceeded,
194-
core_exceptions.ServiceUnavailable,
190+
core_exceptions.GoogleAPICallError,
195191
),
196192
deadline=600.0,
197193
),
@@ -205,8 +201,7 @@ def _prep_wrapped_messages(self, client_info):
205201
maximum=60.0,
206202
multiplier=1.3,
207203
predicate=retries.if_exception_type(
208-
core_exceptions.DeadlineExceeded,
209-
core_exceptions.ServiceUnavailable,
204+
core_exceptions.GoogleAPICallError,
210205
),
211206
deadline=600.0,
212207
),
@@ -296,5 +291,9 @@ def annotate_text(
296291
]:
297292
raise NotImplementedError()
298293

294+
@property
295+
def kind(self) -> str:
296+
raise NotImplementedError()
297+
299298

300299
__all__ = ("LanguageServiceTransport",)

google/cloud/language_v1/services/language_service/transports/grpc.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -412,5 +412,9 @@ def annotate_text(
412412
def close(self):
413413
self.grpc_channel.close()
414414

415+
@property
416+
def kind(self) -> str:
417+
return "grpc"
418+
415419

416420
__all__ = ("LanguageServiceGrpcTransport",)

google/cloud/language_v1/types/language_service.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ class Entity(proto.Message):
160160
The representative name for the entity.
161161
type_ (google.cloud.language_v1.types.Entity.Type):
162162
The entity type.
163-
metadata (Sequence[google.cloud.language_v1.types.Entity.MetadataEntry]):
163+
metadata (Mapping[str, str]):
164164
Metadata associated with the entity.
165165
166166
For most entity types, the metadata is a Wikipedia URL

google/cloud/language_v1beta2/services/language_service/async_client.py

Lines changed: 7 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
from collections import OrderedDict
1717
import functools
1818
import re
19-
from typing import Dict, Optional, Sequence, Tuple, Type, Union
19+
from typing import Dict, Mapping, Optional, Sequence, Tuple, Type, Union
2020
import pkg_resources
2121

2222
from google.api_core.client_options import ClientOptions
@@ -292,8 +292,7 @@ def sample_analyze_sentiment():
292292
maximum=60.0,
293293
multiplier=1.3,
294294
predicate=retries.if_exception_type(
295-
core_exceptions.DeadlineExceeded,
296-
core_exceptions.ServiceUnavailable,
295+
core_exceptions.GoogleAPICallError,
297296
),
298297
deadline=600.0,
299298
),
@@ -327,7 +326,6 @@ async def analyze_entities(
327326
salience, mentions for each entity, and other
328327
properties.
329328
330-
331329
.. code-block:: python
332330
333331
from google.cloud import language_v1beta2
@@ -403,8 +401,7 @@ def sample_analyze_entities():
403401
maximum=60.0,
404402
multiplier=1.3,
405403
predicate=retries.if_exception_type(
406-
core_exceptions.DeadlineExceeded,
407-
core_exceptions.ServiceUnavailable,
404+
core_exceptions.GoogleAPICallError,
408405
),
409406
deadline=600.0,
410407
),
@@ -438,7 +435,6 @@ async def analyze_entity_sentiment(
438435
in the text and analyzes sentiment associated with each entity
439436
and its mentions.
440437
441-
442438
.. code-block:: python
443439
444440
from google.cloud import language_v1beta2
@@ -517,8 +513,7 @@ def sample_analyze_entity_sentiment():
517513
maximum=60.0,
518514
multiplier=1.3,
519515
predicate=retries.if_exception_type(
520-
core_exceptions.DeadlineExceeded,
521-
core_exceptions.ServiceUnavailable,
516+
core_exceptions.GoogleAPICallError,
522517
),
523518
deadline=600.0,
524519
),
@@ -551,7 +546,6 @@ async def analyze_syntax(
551546
boundaries and tokenization along with part-of-speech
552547
tags, dependency trees, and other properties.
553548
554-
555549
.. code-block:: python
556550
557551
from google.cloud import language_v1beta2
@@ -627,8 +621,7 @@ def sample_analyze_syntax():
627621
maximum=60.0,
628622
multiplier=1.3,
629623
predicate=retries.if_exception_type(
630-
core_exceptions.DeadlineExceeded,
631-
core_exceptions.ServiceUnavailable,
624+
core_exceptions.GoogleAPICallError,
632625
),
633626
deadline=600.0,
634627
),
@@ -727,8 +720,7 @@ def sample_classify_text():
727720
maximum=60.0,
728721
multiplier=1.3,
729722
predicate=retries.if_exception_type(
730-
core_exceptions.DeadlineExceeded,
731-
core_exceptions.ServiceUnavailable,
723+
core_exceptions.GoogleAPICallError,
732724
),
733725
deadline=600.0,
734726
),
@@ -762,7 +754,6 @@ async def annotate_text(
762754
sentiment, entity, and classification features in one
763755
call.
764756
765-
766757
.. code-block:: python
767758
768759
from google.cloud import language_v1beta2
@@ -849,8 +840,7 @@ def sample_annotate_text():
849840
maximum=60.0,
850841
multiplier=1.3,
851842
predicate=retries.if_exception_type(
852-
core_exceptions.DeadlineExceeded,
853-
core_exceptions.ServiceUnavailable,
843+
core_exceptions.GoogleAPICallError,
854844
),
855845
deadline=600.0,
856846
),

google/cloud/language_v1beta2/services/language_service/client.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
from collections import OrderedDict
1717
import os
1818
import re
19-
from typing import Dict, Optional, Sequence, Tuple, Type, Union
19+
from typing import Dict, Mapping, Optional, Sequence, Tuple, Type, Union
2020
import pkg_resources
2121

2222
from google.api_core import client_options as client_options_lib
@@ -521,7 +521,6 @@ def analyze_entities(
521521
salience, mentions for each entity, and other
522522
properties.
523523
524-
525524
.. code-block:: python
526525
527526
from google.cloud import language_v1beta2
@@ -622,7 +621,6 @@ def analyze_entity_sentiment(
622621
in the text and analyzes sentiment associated with each entity
623622
and its mentions.
624623
625-
626624
.. code-block:: python
627625
628626
from google.cloud import language_v1beta2
@@ -725,7 +723,6 @@ def analyze_syntax(
725723
boundaries and tokenization along with part-of-speech
726724
tags, dependency trees, and other properties.
727725
728-
729726
.. code-block:: python
730727
731728
from google.cloud import language_v1beta2
@@ -916,7 +913,6 @@ def annotate_text(
916913
sentiment, entity, and classification features in one
917914
call.
918915
919-
920916
.. code-block:: python
921917
922918
from google.cloud import language_v1beta2

0 commit comments

Comments
 (0)