Skip to content

Commit

Permalink
🦉 Updates from OwlBot post-processor
Browse files Browse the repository at this point in the history
  • Loading branch information
gcf-owl-bot[bot] committed Sep 7, 2023
1 parent 7de2cb2 commit 86c7445
Show file tree
Hide file tree
Showing 1,718 changed files with 154 additions and 705,736 deletions.
2 changes: 1 addition & 1 deletion .kokoro/samples/python3.10/common.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ env_vars: {
# Declare build specific Cloud project.
env_vars: {
key: "BUILD_SPECIFIC_GCLOUD_PROJECT"
value: "ucaip-sample-tests"
value: "python-docs-samples-tests-310"
}

env_vars: {
Expand Down
2 changes: 1 addition & 1 deletion .kokoro/samples/python3.11/common.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ env_vars: {
# Declare build specific Cloud project.
env_vars: {
key: "BUILD_SPECIFIC_GCLOUD_PROJECT"
value: "ucaip-sample-tests"
value: "python-docs-samples-tests-311"
}

env_vars: {
Expand Down
2 changes: 1 addition & 1 deletion .kokoro/samples/python3.7/common.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ env_vars: {
# Declare build specific Cloud project.
env_vars: {
key: "BUILD_SPECIFIC_GCLOUD_PROJECT"
value: "ucaip-sample-tests"
value: "python-docs-samples-tests-py37"
}

env_vars: {
Expand Down
2 changes: 1 addition & 1 deletion .kokoro/samples/python3.7/periodic.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@

env_vars: {
key: "INSTALL_LIBRARY_FROM_SOURCE"
value: "True"
value: "False"
}
2 changes: 1 addition & 1 deletion .kokoro/samples/python3.8/common.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ env_vars: {
# Declare build specific Cloud project.
env_vars: {
key: "BUILD_SPECIFIC_GCLOUD_PROJECT"
value: "ucaip-sample-tests"
value: "python-docs-samples-tests-py38"
}

env_vars: {
Expand Down
2 changes: 1 addition & 1 deletion .kokoro/samples/python3.9/common.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ env_vars: {
# Declare build specific Cloud project.
env_vars: {
key: "BUILD_SPECIFIC_GCLOUD_PROJECT"
value: "ucaip-sample-tests"
value: "python-docs-samples-tests-py39"
}

env_vars: {
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@ repos:
hooks:
- id: black
- repo: https://github.com/pycqa/flake8
rev: 6.1.0
rev: 3.9.2
hooks:
- id: flake8
54 changes: 0 additions & 54 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -382,57 +382,3 @@
napoleon_use_ivar = False
napoleon_use_param = True
napoleon_use_rtype = True


def adopt_members_reexported_from_private_modules(public_module: str):
"""Remaps the module items that come from internal modules.
A public module might be exporting items that are imported from private modules.
This function changes the `__module__` of such items to the public module.
Example:
`package/public.py`:
```
from package._private import _PrivateClass as PublicClass
__all__ = ["PublicClass"]
```
Calling this function on the `package.public` module will change:
```
package._private._PrivateClass.__name__ = "PublicClass"
package._private._PrivateClass.__module__ = "package.public"
```
"""
for name, cls in public_module.__dict__.items():
if name in public_module.__all__:
if "._" in cls.__module__:
cls.__name__ = name
cls.__module__ = public_module.__name__


def setup(*args, **kwargs):
# 1. Giving pretty module names to the GA and preview classes
# 2. Giving pretty class names to the preview classes
# 3. Making Sphinx automodule render the class members instead of
# dismissing the exported private classes as "Alias of".
from vertexai import language_models
from vertexai import vision_models
from vertexai.preview import (
language_models as preview_language_models,
)
from vertexai.preview import (
vision_models as preview_vision_models,
)

# There are many possible ways to select which classes to fix.
# We select the publicly exported members that have an internal module ("*._*").

# Setting the modules of the GA classes
adopt_members_reexported_from_private_modules(language_models)
adopt_members_reexported_from_private_modules(vision_models)

# Setting the modules of the public preview classes
# Selecting the members that still have an internal module after the GA fixes.
adopt_members_reexported_from_private_modules(preview_language_models)
adopt_members_reexported_from_private_modules(preview_vision_models)
2 changes: 2 additions & 0 deletions google/cloud/aiplatform_v1/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -494,6 +494,7 @@
from .types.study import Study
from .types.study import StudySpec
from .types.study import Trial
from .types.study import TrialContext
from .types.tensorboard import Tensorboard
from .types.tensorboard_data import Scalar
from .types.tensorboard_data import TensorboardBlob
Expand Down Expand Up @@ -1095,6 +1096,7 @@
"TrainingConfig",
"TrainingPipeline",
"Trial",
"TrialContext",
"UndeployIndexOperationMetadata",
"UndeployIndexRequest",
"UndeployIndexResponse",
Expand Down
84 changes: 0 additions & 84 deletions google/cloud/aiplatform_v1/gapic_metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -1925,90 +1925,6 @@
}
}
},
"ScheduleService": {
"clients": {
"grpc": {
"libraryClient": "ScheduleServiceClient",
"rpcs": {
"CreateSchedule": {
"methods": [
"create_schedule"
]
},
"DeleteSchedule": {
"methods": [
"delete_schedule"
]
},
"GetSchedule": {
"methods": [
"get_schedule"
]
},
"ListSchedules": {
"methods": [
"list_schedules"
]
},
"PauseSchedule": {
"methods": [
"pause_schedule"
]
},
"ResumeSchedule": {
"methods": [
"resume_schedule"
]
},
"UpdateSchedule": {
"methods": [
"update_schedule"
]
}
}
},
"grpc-async": {
"libraryClient": "ScheduleServiceAsyncClient",
"rpcs": {
"CreateSchedule": {
"methods": [
"create_schedule"
]
},
"DeleteSchedule": {
"methods": [
"delete_schedule"
]
},
"GetSchedule": {
"methods": [
"get_schedule"
]
},
"ListSchedules": {
"methods": [
"list_schedules"
]
},
"PauseSchedule": {
"methods": [
"pause_schedule"
]
},
"ResumeSchedule": {
"methods": [
"resume_schedule"
]
},
"UpdateSchedule": {
"methods": [
"update_schedule"
]
}
}
}
}
},
"SpecialistPoolService": {
"clients": {
"grpc": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
from google.api_core import operation as gac_operation # type: ignore
from google.api_core import operation_async # type: ignore
from google.cloud.aiplatform_v1.services.index_endpoint_service import pagers
from google.cloud.aiplatform_v1.types import encryption_spec
from google.cloud.aiplatform_v1.types import index_endpoint
from google.cloud.aiplatform_v1.types import index_endpoint as gca_index_endpoint
from google.cloud.aiplatform_v1.types import index_endpoint_service
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
from google.api_core import operation as gac_operation # type: ignore
from google.api_core import operation_async # type: ignore
from google.cloud.aiplatform_v1.services.index_endpoint_service import pagers
from google.cloud.aiplatform_v1.types import encryption_spec
from google.cloud.aiplatform_v1.types import index_endpoint
from google.cloud.aiplatform_v1.types import index_endpoint as gca_index_endpoint
from google.cloud.aiplatform_v1.types import index_endpoint_service
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
from google.api_core import operation_async # type: ignore
from google.cloud.aiplatform_v1.services.index_service import pagers
from google.cloud.aiplatform_v1.types import deployed_index_ref
from google.cloud.aiplatform_v1.types import encryption_spec
from google.cloud.aiplatform_v1.types import index
from google.cloud.aiplatform_v1.types import index as gca_index
from google.cloud.aiplatform_v1.types import index_service
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
from google.api_core import operation_async # type: ignore
from google.cloud.aiplatform_v1.services.index_service import pagers
from google.cloud.aiplatform_v1.types import deployed_index_ref
from google.cloud.aiplatform_v1.types import encryption_spec
from google.cloud.aiplatform_v1.types import index
from google.cloud.aiplatform_v1.types import index as gca_index
from google.cloud.aiplatform_v1.types import index_service
Expand Down
24 changes: 2 additions & 22 deletions google/cloud/aiplatform_v1/types/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -549,28 +549,6 @@
from .service_networking import (
PrivateServiceConnectConfig,
)
from .publisher_model import (
PublisherModel,
)
from .saved_query import (
SavedQuery,
)
from .schedule import (
Schedule,
)
from .schedule_service import (
CreateScheduleRequest,
DeleteScheduleRequest,
GetScheduleRequest,
ListSchedulesRequest,
ListSchedulesResponse,
PauseScheduleRequest,
ResumeScheduleRequest,
UpdateScheduleRequest,
)
from .service_networking import (
PrivateServiceConnectConfig,
)
from .specialist_pool import (
SpecialistPool,
)
Expand All @@ -589,6 +567,7 @@
Study,
StudySpec,
Trial,
TrialContext,
)
from .tensorboard import (
Tensorboard,
Expand Down Expand Up @@ -1136,6 +1115,7 @@
"Study",
"StudySpec",
"Trial",
"TrialContext",
"Tensorboard",
"Scalar",
"TensorboardBlob",
Expand Down
11 changes: 11 additions & 0 deletions google/cloud/aiplatform_v1/types/index.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import proto # type: ignore

from google.cloud.aiplatform_v1.types import deployed_index_ref
from google.cloud.aiplatform_v1.types import encryption_spec as gca_encryption_spec
from google.protobuf import struct_pb2 # type: ignore
from google.protobuf import timestamp_pb2 # type: ignore

Expand Down Expand Up @@ -101,6 +102,11 @@ class Index(proto.Message):
index_update_method (google.cloud.aiplatform_v1.types.Index.IndexUpdateMethod):
Immutable. The update method to use with this Index. If not
set, BATCH_UPDATE will be used by default.
encryption_spec (google.cloud.aiplatform_v1.types.EncryptionSpec):
Immutable. Customer-managed encryption key
spec for an Index. If set, this Index and all
sub-resources of this Index will be secured by
this key.
"""

class IndexUpdateMethod(proto.Enum):
Expand Down Expand Up @@ -181,6 +187,11 @@ class IndexUpdateMethod(proto.Enum):
number=16,
enum=IndexUpdateMethod,
)
encryption_spec: gca_encryption_spec.EncryptionSpec = proto.Field(
proto.MESSAGE,
number=17,
message=gca_encryption_spec.EncryptionSpec,
)


class IndexDatapoint(proto.Message):
Expand Down
11 changes: 11 additions & 0 deletions google/cloud/aiplatform_v1/types/index_endpoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

import proto # type: ignore

from google.cloud.aiplatform_v1.types import encryption_spec as gca_encryption_spec
from google.cloud.aiplatform_v1.types import machine_resources
from google.cloud.aiplatform_v1.types import service_networking
from google.protobuf import timestamp_pb2 # type: ignore
Expand Down Expand Up @@ -119,6 +120,11 @@ class IndexEndpoint(proto.Message):
[public_endpoint_enabled][google.cloud.aiplatform.v1.IndexEndpoint.public_endpoint_enabled]
is true, this field will be populated with the domain name
to use for this index endpoint.
encryption_spec (google.cloud.aiplatform_v1.types.EncryptionSpec):
Immutable. Customer-managed encryption key
spec for an IndexEndpoint. If set, this
IndexEndpoint and all sub-resources of this
IndexEndpoint will be secured by this key.
"""

name: str = proto.Field(
Expand Down Expand Up @@ -180,6 +186,11 @@ class IndexEndpoint(proto.Message):
proto.STRING,
number=14,
)
encryption_spec: gca_encryption_spec.EncryptionSpec = proto.Field(
proto.MESSAGE,
number=15,
message=gca_encryption_spec.EncryptionSpec,
)


class DeployedIndex(proto.Message):
Expand Down
Loading

0 comments on commit 86c7445

Please sign in to comment.