Skip to content

Commit 2d75d0e

Browse files
fix: [Many APIs] fix ValueError in test__validate_universe_domain (#12280)
- [ ] Regenerate this pull request now. PiperOrigin-RevId: 604699565 Source-Link: googleapis/googleapis@cd3eabf Source-Link: googleapis/googleapis-gen@01f69ba Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWFpLWdlbmVyYXRpdmVsYW5ndWFnZS8uT3dsQm90LnlhbWwiLCJoIjoiMDFmNjliYTdhMTNkNTllNmY0NWUyNDMzNTliOTFhNmU4OTYyMjFmOCJ9 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWFuYWx5dGljcy1hZG1pbi8uT3dsQm90LnlhbWwiLCJoIjoiMDFmNjliYTdhMTNkNTllNmY0NWUyNDMzNTliOTFhNmU4OTYyMjFmOCJ9 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWFuYWx5dGljcy1kYXRhLy5Pd2xCb3QueWFtbCIsImgiOiIwMWY2OWJhN2ExM2Q1OWU2ZjQ1ZTI0MzM1OWI5MWE2ZTg5NjIyMWY4In0= Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWFwcHMtbWVldC8uT3dsQm90LnlhbWwiLCJoIjoiMDFmNjliYTdhMTNkNTllNmY0NWUyNDMzNTliOTFhNmU4OTYyMjFmOCJ9 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWFwcHMtc2NyaXB0LXR5cGUvLk93bEJvdC55YW1sIiwiaCI6IjAxZjY5YmE3YTEzZDU5ZTZmNDVlMjQzMzU5YjkxYTZlODk2MjIxZjgifQ== Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWFyZWExMjAtdGFibGVzLy5Pd2xCb3QueWFtbCIsImgiOiIwMWY2OWJhN2ExM2Q1OWU2ZjQ1ZTI0MzM1OWI5MWE2ZTg5NjIyMWY4In0= Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWFjY2Vzcy1hcHByb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
1 parent 62cf934 commit 2d75d0e

63 files changed

Lines changed: 246 additions & 246 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

packages/google-ai-generativelanguage/google/ai/generativelanguage_v1beta/types/retriever.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ class Document(proto.Message):
8888
Attributes:
8989
name (str):
9090
Immutable. Identifier. The ``Document`` resource name. The
91-
ID (name excluding the `corpora/*/documents/` prefix) can
91+
ID (name excluding the "corpora/*/documents/" prefix) can
9292
contain up to 40 characters that are lowercase alphanumeric
9393
or dashes (-). The ID cannot start or end with a dash. If
9494
the name is empty on create, a unique name will be derived
@@ -315,7 +315,7 @@ class Chunk(proto.Message):
315315
Attributes:
316316
name (str):
317317
Immutable. Identifier. The ``Chunk`` resource name. The ID
318-
(name excluding the `corpora/*/documents/*/chunks/` prefix)
318+
(name excluding the "corpora/*/documents/*/chunks/" prefix)
319319
can contain up to 40 characters that are lowercase
320320
alphanumeric or dashes (-). The ID cannot start or end with
321321
a dash. If the name is empty on create, a random

packages/google-ai-generativelanguage/google/ai/generativelanguage_v1beta3/services/permission_service/async_client.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -343,11 +343,11 @@ async def sample_create_permission():
343343
role is a superset of the previous
344344
role's permitted operations:
345345
346-
- reader can use the resource (e.g.
346+
- reader can use the resource (e.g.
347347
tuned model) for inference
348-
- writer has reader's permissions and
348+
- writer has reader's permissions and
349349
additionally can edit and share
350-
- owner has writer's permissions and
350+
- owner has writer's permissions and
351351
additionally can delete
352352
353353
"""
@@ -473,11 +473,11 @@ async def sample_get_permission():
473473
role is a superset of the previous
474474
role's permitted operations:
475475
476-
- reader can use the resource (e.g.
476+
- reader can use the resource (e.g.
477477
tuned model) for inference
478-
- writer has reader's permissions and
478+
- writer has reader's permissions and
479479
additionally can edit and share
480-
- owner has writer's permissions and
480+
- owner has writer's permissions and
481481
additionally can delete
482482
483483
"""
@@ -729,11 +729,11 @@ async def sample_update_permission():
729729
role is a superset of the previous
730730
role's permitted operations:
731731
732-
- reader can use the resource (e.g.
732+
- reader can use the resource (e.g.
733733
tuned model) for inference
734-
- writer has reader's permissions and
734+
- writer has reader's permissions and
735735
additionally can edit and share
736-
- owner has writer's permissions and
736+
- owner has writer's permissions and
737737
additionally can delete
738738
739739
"""

packages/google-ai-generativelanguage/google/ai/generativelanguage_v1beta3/services/permission_service/client.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -764,11 +764,11 @@ def sample_create_permission():
764764
role is a superset of the previous
765765
role's permitted operations:
766766
767-
- reader can use the resource (e.g.
767+
- reader can use the resource (e.g.
768768
tuned model) for inference
769-
- writer has reader's permissions and
769+
- writer has reader's permissions and
770770
additionally can edit and share
771-
- owner has writer's permissions and
771+
- owner has writer's permissions and
772772
additionally can delete
773773
774774
"""
@@ -894,11 +894,11 @@ def sample_get_permission():
894894
role is a superset of the previous
895895
role's permitted operations:
896896
897-
- reader can use the resource (e.g.
897+
- reader can use the resource (e.g.
898898
tuned model) for inference
899-
- writer has reader's permissions and
899+
- writer has reader's permissions and
900900
additionally can edit and share
901-
- owner has writer's permissions and
901+
- owner has writer's permissions and
902902
additionally can delete
903903
904904
"""
@@ -1150,11 +1150,11 @@ def sample_update_permission():
11501150
role is a superset of the previous
11511151
role's permitted operations:
11521152
1153-
- reader can use the resource (e.g.
1153+
- reader can use the resource (e.g.
11541154
tuned model) for inference
1155-
- writer has reader's permissions and
1155+
- writer has reader's permissions and
11561156
additionally can edit and share
1157-
- owner has writer's permissions and
1157+
- owner has writer's permissions and
11581158
additionally can delete
11591159
11601160
"""

packages/google-ai-generativelanguage/google/ai/generativelanguage_v1beta3/services/permission_service/transports/rest.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -395,11 +395,11 @@ def __call__(
395395
role is a superset of the previous
396396
role's permitted operations:
397397
398-
- reader can use the resource (e.g.
398+
- reader can use the resource (e.g.
399399
tuned model) for inference
400-
- writer has reader's permissions and
400+
- writer has reader's permissions and
401401
additionally can edit and share
402-
- owner has writer's permissions and
402+
- owner has writer's permissions and
403403
additionally can delete
404404
405405
"""
@@ -592,11 +592,11 @@ def __call__(
592592
role is a superset of the previous
593593
role's permitted operations:
594594
595-
- reader can use the resource (e.g.
595+
- reader can use the resource (e.g.
596596
tuned model) for inference
597-
- writer has reader's permissions and
597+
- writer has reader's permissions and
598598
additionally can edit and share
599-
- owner has writer's permissions and
599+
- owner has writer's permissions and
600600
additionally can delete
601601
602602
"""
@@ -891,11 +891,11 @@ def __call__(
891891
role is a superset of the previous
892892
role's permitted operations:
893893
894-
- reader can use the resource (e.g.
894+
- reader can use the resource (e.g.
895895
tuned model) for inference
896-
- writer has reader's permissions and
896+
- writer has reader's permissions and
897897
additionally can edit and share
898-
- owner has writer's permissions and
898+
- owner has writer's permissions and
899899
additionally can delete
900900
901901
"""

packages/google-ai-generativelanguage/google/ai/generativelanguage_v1beta3/types/permission.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,10 @@ class Permission(proto.Message):
4141
There are three concentric roles. Each role is a superset of the
4242
previous role's permitted operations:
4343
44-
- reader can use the resource (e.g. tuned model) for inference
45-
- writer has reader's permissions and additionally can edit and
44+
- reader can use the resource (e.g. tuned model) for inference
45+
- writer has reader's permissions and additionally can edit and
4646
share
47-
- owner has writer's permissions and additionally can delete
47+
- owner has writer's permissions and additionally can delete
4848
4949
5050
.. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields

packages/google-ai-generativelanguage/tests/unit/gapic/generativelanguage_v1/test_generative_service.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -344,8 +344,8 @@ def test__validate_universe_domain(client_class, transport_class, transport_name
344344
# TODO: This is needed to cater for older versions of google-auth
345345
# Make this test unconditional once the minimum supported version of
346346
# google-auth becomes 2.23.0 or higher.
347-
google_auth_major, google_auth_minor, _ = [
348-
int(part) for part in google.auth.__version__.split(".")
347+
google_auth_major, google_auth_minor = [
348+
int(part) for part in google.auth.__version__.split(".")[0:2]
349349
]
350350
if google_auth_major > 2 or (google_auth_major == 2 and google_auth_minor >= 23):
351351
credentials = ga_credentials.AnonymousCredentials()
@@ -363,8 +363,8 @@ def test__validate_universe_domain(client_class, transport_class, transport_name
363363
#
364364
# TODO: Make this test unconditional once the minimum supported version of
365365
# google-api-core becomes 2.15.0 or higher.
366-
api_core_major, api_core_minor, _ = [
367-
int(part) for part in api_core_version.__version__.split(".")
366+
api_core_major, api_core_minor = [
367+
int(part) for part in api_core_version.__version__.split(".")[0:2]
368368
]
369369
if api_core_major > 2 or (api_core_major == 2 and api_core_minor >= 15):
370370
client = client_class(

packages/google-ai-generativelanguage/tests/unit/gapic/generativelanguage_v1/test_model_service.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -319,8 +319,8 @@ def test__validate_universe_domain(client_class, transport_class, transport_name
319319
# TODO: This is needed to cater for older versions of google-auth
320320
# Make this test unconditional once the minimum supported version of
321321
# google-auth becomes 2.23.0 or higher.
322-
google_auth_major, google_auth_minor, _ = [
323-
int(part) for part in google.auth.__version__.split(".")
322+
google_auth_major, google_auth_minor = [
323+
int(part) for part in google.auth.__version__.split(".")[0:2]
324324
]
325325
if google_auth_major > 2 or (google_auth_major == 2 and google_auth_minor >= 23):
326326
credentials = ga_credentials.AnonymousCredentials()
@@ -338,8 +338,8 @@ def test__validate_universe_domain(client_class, transport_class, transport_name
338338
#
339339
# TODO: Make this test unconditional once the minimum supported version of
340340
# google-api-core becomes 2.15.0 or higher.
341-
api_core_major, api_core_minor, _ = [
342-
int(part) for part in api_core_version.__version__.split(".")
341+
api_core_major, api_core_minor = [
342+
int(part) for part in api_core_version.__version__.split(".")[0:2]
343343
]
344344
if api_core_major > 2 or (api_core_major == 2 and api_core_minor >= 15):
345345
client = client_class(

packages/google-ai-generativelanguage/tests/unit/gapic/generativelanguage_v1beta/test_discuss_service.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -333,8 +333,8 @@ def test__validate_universe_domain(client_class, transport_class, transport_name
333333
# TODO: This is needed to cater for older versions of google-auth
334334
# Make this test unconditional once the minimum supported version of
335335
# google-auth becomes 2.23.0 or higher.
336-
google_auth_major, google_auth_minor, _ = [
337-
int(part) for part in google.auth.__version__.split(".")
336+
google_auth_major, google_auth_minor = [
337+
int(part) for part in google.auth.__version__.split(".")[0:2]
338338
]
339339
if google_auth_major > 2 or (google_auth_major == 2 and google_auth_minor >= 23):
340340
credentials = ga_credentials.AnonymousCredentials()
@@ -352,8 +352,8 @@ def test__validate_universe_domain(client_class, transport_class, transport_name
352352
#
353353
# TODO: Make this test unconditional once the minimum supported version of
354354
# google-api-core becomes 2.15.0 or higher.
355-
api_core_major, api_core_minor, _ = [
356-
int(part) for part in api_core_version.__version__.split(".")
355+
api_core_major, api_core_minor = [
356+
int(part) for part in api_core_version.__version__.split(".")[0:2]
357357
]
358358
if api_core_major > 2 or (api_core_major == 2 and api_core_minor >= 15):
359359
client = client_class(

packages/google-ai-generativelanguage/tests/unit/gapic/generativelanguage_v1beta/test_generative_service.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -349,8 +349,8 @@ def test__validate_universe_domain(client_class, transport_class, transport_name
349349
# TODO: This is needed to cater for older versions of google-auth
350350
# Make this test unconditional once the minimum supported version of
351351
# google-auth becomes 2.23.0 or higher.
352-
google_auth_major, google_auth_minor, _ = [
353-
int(part) for part in google.auth.__version__.split(".")
352+
google_auth_major, google_auth_minor = [
353+
int(part) for part in google.auth.__version__.split(".")[0:2]
354354
]
355355
if google_auth_major > 2 or (google_auth_major == 2 and google_auth_minor >= 23):
356356
credentials = ga_credentials.AnonymousCredentials()
@@ -368,8 +368,8 @@ def test__validate_universe_domain(client_class, transport_class, transport_name
368368
#
369369
# TODO: Make this test unconditional once the minimum supported version of
370370
# google-api-core becomes 2.15.0 or higher.
371-
api_core_major, api_core_minor, _ = [
372-
int(part) for part in api_core_version.__version__.split(".")
371+
api_core_major, api_core_minor = [
372+
int(part) for part in api_core_version.__version__.split(".")[0:2]
373373
]
374374
if api_core_major > 2 or (api_core_major == 2 and api_core_minor >= 15):
375375
client = client_class(

packages/google-ai-generativelanguage/tests/unit/gapic/generativelanguage_v1beta/test_model_service.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -332,8 +332,8 @@ def test__validate_universe_domain(client_class, transport_class, transport_name
332332
# TODO: This is needed to cater for older versions of google-auth
333333
# Make this test unconditional once the minimum supported version of
334334
# google-auth becomes 2.23.0 or higher.
335-
google_auth_major, google_auth_minor, _ = [
336-
int(part) for part in google.auth.__version__.split(".")
335+
google_auth_major, google_auth_minor = [
336+
int(part) for part in google.auth.__version__.split(".")[0:2]
337337
]
338338
if google_auth_major > 2 or (google_auth_major == 2 and google_auth_minor >= 23):
339339
credentials = ga_credentials.AnonymousCredentials()
@@ -351,8 +351,8 @@ def test__validate_universe_domain(client_class, transport_class, transport_name
351351
#
352352
# TODO: Make this test unconditional once the minimum supported version of
353353
# google-api-core becomes 2.15.0 or higher.
354-
api_core_major, api_core_minor, _ = [
355-
int(part) for part in api_core_version.__version__.split(".")
354+
api_core_major, api_core_minor = [
355+
int(part) for part in api_core_version.__version__.split(".")[0:2]
356356
]
357357
if api_core_major > 2 or (api_core_major == 2 and api_core_minor >= 15):
358358
client = client_class(

0 commit comments

Comments
 (0)