diff --git a/google/cloud/datalabeling_v1beta1/services/data_labeling_service/transports/__init__.py b/google/cloud/datalabeling_v1beta1/services/data_labeling_service/transports/__init__.py index fcc0f42..f415856 100644 --- a/google/cloud/datalabeling_v1beta1/services/data_labeling_service/transports/__init__.py +++ b/google/cloud/datalabeling_v1beta1/services/data_labeling_service/transports/__init__.py @@ -30,7 +30,6 @@ _transport_registry["grpc"] = DataLabelingServiceGrpcTransport _transport_registry["grpc_asyncio"] = DataLabelingServiceGrpcAsyncIOTransport - __all__ = ( "DataLabelingServiceTransport", "DataLabelingServiceGrpcTransport", diff --git a/google/cloud/datalabeling_v1beta1/services/data_labeling_service/transports/grpc.py b/google/cloud/datalabeling_v1beta1/services/data_labeling_service/transports/grpc.py index f242bad..50a5adc 100644 --- a/google/cloud/datalabeling_v1beta1/services/data_labeling_service/transports/grpc.py +++ b/google/cloud/datalabeling_v1beta1/services/data_labeling_service/transports/grpc.py @@ -159,6 +159,10 @@ def __init__( ssl_credentials=ssl_credentials, scopes=scopes or self.AUTH_SCOPES, quota_project_id=quota_project_id, + options=[ + ("grpc.max_send_message_length", -1), + ("grpc.max_receive_message_length", -1), + ], ) self._ssl_channel_credentials = ssl_credentials else: @@ -177,9 +181,14 @@ def __init__( ssl_credentials=ssl_channel_credentials, scopes=scopes or self.AUTH_SCOPES, quota_project_id=quota_project_id, + options=[ + ("grpc.max_send_message_length", -1), + ("grpc.max_receive_message_length", -1), + ], ) self._stubs = {} # type: Dict[str, Callable] + self._operations_client = None # Run the base constructor. super().__init__( @@ -203,7 +212,7 @@ def create_channel( ) -> grpc.Channel: """Create and return a gRPC channel object. Args: - address (Optionsl[str]): The host for the channel to use. + address (Optional[str]): The host for the channel to use. credentials (Optional[~.Credentials]): The authorization credentials to attach to requests. These credentials identify this application to the service. If @@ -250,13 +259,11 @@ def operations_client(self) -> operations_v1.OperationsClient: client. """ # Sanity check: Only create a new client if we do not already have one. - if "operations_client" not in self.__dict__: - self.__dict__["operations_client"] = operations_v1.OperationsClient( - self.grpc_channel - ) + if self._operations_client is None: + self._operations_client = operations_v1.OperationsClient(self.grpc_channel) # Return the client from cache. - return self.__dict__["operations_client"] + return self._operations_client @property def create_dataset( diff --git a/google/cloud/datalabeling_v1beta1/services/data_labeling_service/transports/grpc_asyncio.py b/google/cloud/datalabeling_v1beta1/services/data_labeling_service/transports/grpc_asyncio.py index 223a86f..094633e 100644 --- a/google/cloud/datalabeling_v1beta1/services/data_labeling_service/transports/grpc_asyncio.py +++ b/google/cloud/datalabeling_v1beta1/services/data_labeling_service/transports/grpc_asyncio.py @@ -204,6 +204,10 @@ def __init__( ssl_credentials=ssl_credentials, scopes=scopes or self.AUTH_SCOPES, quota_project_id=quota_project_id, + options=[ + ("grpc.max_send_message_length", -1), + ("grpc.max_receive_message_length", -1), + ], ) self._ssl_channel_credentials = ssl_credentials else: @@ -222,6 +226,10 @@ def __init__( ssl_credentials=ssl_channel_credentials, scopes=scopes or self.AUTH_SCOPES, quota_project_id=quota_project_id, + options=[ + ("grpc.max_send_message_length", -1), + ("grpc.max_receive_message_length", -1), + ], ) # Run the base constructor. @@ -235,6 +243,7 @@ def __init__( ) self._stubs = {} + self._operations_client = None @property def grpc_channel(self) -> aio.Channel: @@ -254,13 +263,13 @@ def operations_client(self) -> operations_v1.OperationsAsyncClient: client. """ # Sanity check: Only create a new client if we do not already have one. - if "operations_client" not in self.__dict__: - self.__dict__["operations_client"] = operations_v1.OperationsAsyncClient( + if self._operations_client is None: + self._operations_client = operations_v1.OperationsAsyncClient( self.grpc_channel ) # Return the client from cache. - return self.__dict__["operations_client"] + return self._operations_client @property def create_dataset( diff --git a/google/cloud/datalabeling_v1beta1/types/__init__.py b/google/cloud/datalabeling_v1beta1/types/__init__.py index 83828e1..9c2e63e 100644 --- a/google/cloud/datalabeling_v1beta1/types/__init__.py +++ b/google/cloud/datalabeling_v1beta1/types/__init__.py @@ -42,6 +42,9 @@ VideoEventAnnotation, AnnotationMetadata, OperatorMetadata, + AnnotationSource, + AnnotationSentiment, + AnnotationType, ) from .data_payloads import ( ImagePayload, @@ -62,6 +65,7 @@ TextClassificationConfig, SentimentConfig, TextEntityExtractionConfig, + StringAggregationType, ) from .dataset import ( Dataset, @@ -78,6 +82,7 @@ LabelStats, AnnotatedDatasetMetadata, Example, + DataType, ) from .evaluation import ( Evaluation, @@ -166,7 +171,6 @@ CreateInstructionMetadata, ) - __all__ = ( "AnnotationSpecSet", "AnnotationSpec", @@ -192,6 +196,9 @@ "VideoEventAnnotation", "AnnotationMetadata", "OperatorMetadata", + "AnnotationSource", + "AnnotationSentiment", + "AnnotationType", "ImagePayload", "TextPayload", "VideoThumbnail", @@ -208,6 +215,7 @@ "TextClassificationConfig", "SentimentConfig", "TextEntityExtractionConfig", + "StringAggregationType", "Dataset", "InputConfig", "TextMetadata", @@ -222,6 +230,7 @@ "LabelStats", "AnnotatedDatasetMetadata", "Example", + "DataType", "Evaluation", "EvaluationConfig", "BoundingBoxEvaluationOptions", diff --git a/synth.metadata b/synth.metadata index a6423e9..997edeb 100644 --- a/synth.metadata +++ b/synth.metadata @@ -3,16 +3,16 @@ { "git": { "name": ".", - "remote": "git@github.com:googleapis/python-datalabeling.git", - "sha": "3dac8e068118b5dea339653b0a731461c236c545" + "remote": "https://github.com/googleapis/python-datalabeling.git", + "sha": "3d643383e481fa22093756343bdf50eba002b1f8" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "5fdb685a684269e07c10c7518372eb5d7b6bc0a9", - "internalRef": "342906697" + "sha": "dd372aa22ded7a8ba6f0e03a80e06358a3fa0907", + "internalRef": "347055288" } }, { @@ -40,5 +40,113 @@ "generator": "bazel" } } + ], + "generatedFiles": [ + ".flake8", + ".github/CONTRIBUTING.md", + ".github/ISSUE_TEMPLATE/bug_report.md", + ".github/ISSUE_TEMPLATE/feature_request.md", + ".github/ISSUE_TEMPLATE/support_request.md", + ".github/PULL_REQUEST_TEMPLATE.md", + ".github/release-please.yml", + ".github/snippet-bot.yml", + ".gitignore", + ".kokoro/build.sh", + ".kokoro/continuous/common.cfg", + ".kokoro/continuous/continuous.cfg", + ".kokoro/docker/docs/Dockerfile", + ".kokoro/docker/docs/fetch_gpg_keys.sh", + ".kokoro/docs/common.cfg", + ".kokoro/docs/docs-presubmit.cfg", + ".kokoro/docs/docs.cfg", + ".kokoro/populate-secrets.sh", + ".kokoro/presubmit/common.cfg", + ".kokoro/presubmit/presubmit.cfg", + ".kokoro/publish-docs.sh", + ".kokoro/release.sh", + ".kokoro/release/common.cfg", + ".kokoro/release/release.cfg", + ".kokoro/samples/lint/common.cfg", + ".kokoro/samples/lint/continuous.cfg", + ".kokoro/samples/lint/periodic.cfg", + ".kokoro/samples/lint/presubmit.cfg", + ".kokoro/samples/python3.6/common.cfg", + ".kokoro/samples/python3.6/continuous.cfg", + ".kokoro/samples/python3.6/periodic.cfg", + ".kokoro/samples/python3.6/presubmit.cfg", + ".kokoro/samples/python3.7/common.cfg", + ".kokoro/samples/python3.7/continuous.cfg", + ".kokoro/samples/python3.7/periodic.cfg", + ".kokoro/samples/python3.7/presubmit.cfg", + ".kokoro/samples/python3.8/common.cfg", + ".kokoro/samples/python3.8/continuous.cfg", + ".kokoro/samples/python3.8/periodic.cfg", + ".kokoro/samples/python3.8/presubmit.cfg", + ".kokoro/test-samples.sh", + ".kokoro/trampoline.sh", + ".kokoro/trampoline_v2.sh", + ".trampolinerc", + "CODE_OF_CONDUCT.md", + "CONTRIBUTING.rst", + "LICENSE", + "MANIFEST.in", + "docs/_static/custom.css", + "docs/_templates/layout.html", + "docs/conf.py", + "docs/datalabeling_v1beta1/services.rst", + "docs/datalabeling_v1beta1/types.rst", + "docs/multiprocessing.rst", + "google/cloud/datalabeling/__init__.py", + "google/cloud/datalabeling/py.typed", + "google/cloud/datalabeling_v1beta1/__init__.py", + "google/cloud/datalabeling_v1beta1/proto/annotation.proto", + "google/cloud/datalabeling_v1beta1/proto/annotation_spec_set.proto", + "google/cloud/datalabeling_v1beta1/proto/data_labeling_service.proto", + "google/cloud/datalabeling_v1beta1/proto/data_payloads.proto", + "google/cloud/datalabeling_v1beta1/proto/dataset.proto", + "google/cloud/datalabeling_v1beta1/proto/evaluation.proto", + "google/cloud/datalabeling_v1beta1/proto/evaluation_job.proto", + "google/cloud/datalabeling_v1beta1/proto/human_annotation_config.proto", + "google/cloud/datalabeling_v1beta1/proto/instruction.proto", + "google/cloud/datalabeling_v1beta1/proto/operations.proto", + "google/cloud/datalabeling_v1beta1/py.typed", + "google/cloud/datalabeling_v1beta1/services/__init__.py", + "google/cloud/datalabeling_v1beta1/services/data_labeling_service/__init__.py", + "google/cloud/datalabeling_v1beta1/services/data_labeling_service/async_client.py", + "google/cloud/datalabeling_v1beta1/services/data_labeling_service/client.py", + "google/cloud/datalabeling_v1beta1/services/data_labeling_service/pagers.py", + "google/cloud/datalabeling_v1beta1/services/data_labeling_service/transports/__init__.py", + "google/cloud/datalabeling_v1beta1/services/data_labeling_service/transports/base.py", + "google/cloud/datalabeling_v1beta1/services/data_labeling_service/transports/grpc.py", + "google/cloud/datalabeling_v1beta1/services/data_labeling_service/transports/grpc_asyncio.py", + "google/cloud/datalabeling_v1beta1/types/__init__.py", + "google/cloud/datalabeling_v1beta1/types/annotation.py", + "google/cloud/datalabeling_v1beta1/types/annotation_spec_set.py", + "google/cloud/datalabeling_v1beta1/types/data_labeling_service.py", + "google/cloud/datalabeling_v1beta1/types/data_payloads.py", + "google/cloud/datalabeling_v1beta1/types/dataset.py", + "google/cloud/datalabeling_v1beta1/types/evaluation.py", + "google/cloud/datalabeling_v1beta1/types/evaluation_job.py", + "google/cloud/datalabeling_v1beta1/types/human_annotation_config.py", + "google/cloud/datalabeling_v1beta1/types/instruction.py", + "google/cloud/datalabeling_v1beta1/types/operations.py", + "mypy.ini", + "noxfile.py", + "renovate.json", + "samples/AUTHORING_GUIDE.md", + "samples/CONTRIBUTING.md", + "samples/snippets/noxfile.py", + "scripts/decrypt-secrets.sh", + "scripts/fixup_datalabeling_v1beta1_keywords.py", + "scripts/readme-gen/readme_gen.py", + "scripts/readme-gen/templates/README.tmpl.rst", + "scripts/readme-gen/templates/auth.tmpl.rst", + "scripts/readme-gen/templates/auth_api_key.tmpl.rst", + "scripts/readme-gen/templates/install_deps.tmpl.rst", + "scripts/readme-gen/templates/install_portaudio.tmpl.rst", + "setup.cfg", + "testing/.gitignore", + "tests/unit/gapic/datalabeling_v1beta1/__init__.py", + "tests/unit/gapic/datalabeling_v1beta1/test_data_labeling_service.py" ] } \ No newline at end of file diff --git a/tests/unit/gapic/datalabeling_v1beta1/test_data_labeling_service.py b/tests/unit/gapic/datalabeling_v1beta1/test_data_labeling_service.py index 8e68492..e2c60c3 100644 --- a/tests/unit/gapic/datalabeling_v1beta1/test_data_labeling_service.py +++ b/tests/unit/gapic/datalabeling_v1beta1/test_data_labeling_service.py @@ -9747,6 +9747,10 @@ def test_data_labeling_service_transport_channel_mtls_with_client_cert_source( scopes=("https://www.googleapis.com/auth/cloud-platform",), ssl_credentials=mock_ssl_cred, quota_project_id=None, + options=[ + ("grpc.max_send_message_length", -1), + ("grpc.max_receive_message_length", -1), + ], ) assert transport.grpc_channel == mock_grpc_channel assert transport._ssl_channel_credentials == mock_ssl_cred @@ -9788,6 +9792,10 @@ def test_data_labeling_service_transport_channel_mtls_with_adc(transport_class): scopes=("https://www.googleapis.com/auth/cloud-platform",), ssl_credentials=mock_ssl_cred, quota_project_id=None, + options=[ + ("grpc.max_send_message_length", -1), + ("grpc.max_receive_message_length", -1), + ], ) assert transport.grpc_channel == mock_grpc_channel