From ba665ddd4e33564cb1175e102e0b895a4eb98736 Mon Sep 17 00:00:00 2001 From: Kian-Meng Ang Date: Fri, 25 Oct 2024 23:57:19 +0800 Subject: [PATCH 1/2] chore: fix typos Found via `codespell -H` and `typos --hidden --format brief` --- .kokoro/test-samples-impl.sh | 2 +- .kokoro/trampoline_v2.sh | 2 +- google/cloud/pubsublite/cloudpubsub/message_transforms.py | 6 +++--- .../pubsublite_v1/services/cursor_service/async_client.py | 2 +- .../cloud/pubsublite_v1/services/cursor_service/client.py | 2 +- .../services/cursor_service/transports/grpc.py | 2 +- .../services/cursor_service/transports/grpc_asyncio.py | 2 +- samples/snippets/noxfile_config.py | 2 +- samples/snippets/publish_with_batch_settings_example.py | 4 ++-- samples/snippets/publish_with_ordering_key_example.py | 2 +- samples/snippets/update_lite_topic_example.py | 4 ++-- 11 files changed, 15 insertions(+), 15 deletions(-) diff --git a/.kokoro/test-samples-impl.sh b/.kokoro/test-samples-impl.sh index 55910c8b..f987b896 100755 --- a/.kokoro/test-samples-impl.sh +++ b/.kokoro/test-samples-impl.sh @@ -35,7 +35,7 @@ env | grep KOKORO # Install nox python3.9 -m pip install --upgrade --quiet nox -# Use secrets acessor service account to get secrets +# Use secrets accessor service account to get secrets if [[ -f "${KOKORO_GFILE_DIR}/secrets_viewer_service_account.json" ]]; then gcloud auth activate-service-account \ --key-file="${KOKORO_GFILE_DIR}/secrets_viewer_service_account.json" \ diff --git a/.kokoro/trampoline_v2.sh b/.kokoro/trampoline_v2.sh index 35fa5292..9ba314ef 100755 --- a/.kokoro/trampoline_v2.sh +++ b/.kokoro/trampoline_v2.sh @@ -391,7 +391,7 @@ docker_flags=( # Use the host network. "--network=host" - # Run in priviledged mode. We are not using docker for sandboxing or + # Run in privileged mode. We are not using docker for sandboxing or # isolation, just for packaging our dev tools. "--privileged" diff --git a/google/cloud/pubsublite/cloudpubsub/message_transforms.py b/google/cloud/pubsublite/cloudpubsub/message_transforms.py index 7f56711b..c3bbfddf 100644 --- a/google/cloud/pubsublite/cloudpubsub/message_transforms.py +++ b/google/cloud/pubsublite/cloudpubsub/message_transforms.py @@ -58,14 +58,14 @@ def decode_attribute_event_time(attr: str) -> datetime.datetime: def _parse_attributes(values: AttributeValues) -> str: if not len(values.values) == 1: raise InvalidArgument( - "Received an unparseable message with multiple values for an attribute." + "Received an unparsable message with multiple values for an attribute." ) value: bytes = values.values[0] try: return value.decode("utf-8") except UnicodeError: raise InvalidArgument( - "Received an unparseable message with a non-utf8 attribute." + "Received an unparsable message with a non-utf8 attribute." ) @@ -104,7 +104,7 @@ def _to_cps_publish_message_proto( try: out.ordering_key = source.key.decode("utf-8") except UnicodeError: - raise InvalidArgument("Received an unparseable message with a non-utf8 key.") + raise InvalidArgument("Received an unparsable message with a non-utf8 key.") if PUBSUB_LITE_EVENT_TIME in source.attributes: raise InvalidArgument( "Special timestamp attribute exists in wire message. Unable to parse message." diff --git a/google/cloud/pubsublite_v1/services/cursor_service/async_client.py b/google/cloud/pubsublite_v1/services/cursor_service/async_client.py index c1fa88e7..33efd99b 100644 --- a/google/cloud/pubsublite_v1/services/cursor_service/async_client.py +++ b/google/cloud/pubsublite_v1/services/cursor_service/async_client.py @@ -56,7 +56,7 @@ class CursorServiceAsyncClient: """The service that a subscriber client application uses to - manage committed cursors while receiving messsages. A cursor + manage committed cursors while receiving messages. A cursor represents a subscriber's progress within a topic partition for a given subscription. """ diff --git a/google/cloud/pubsublite_v1/services/cursor_service/client.py b/google/cloud/pubsublite_v1/services/cursor_service/client.py index b70644c2..14caa9d7 100644 --- a/google/cloud/pubsublite_v1/services/cursor_service/client.py +++ b/google/cloud/pubsublite_v1/services/cursor_service/client.py @@ -94,7 +94,7 @@ def get_transport_class( class CursorServiceClient(metaclass=CursorServiceClientMeta): """The service that a subscriber client application uses to - manage committed cursors while receiving messsages. A cursor + manage committed cursors while receiving messages. A cursor represents a subscriber's progress within a topic partition for a given subscription. """ diff --git a/google/cloud/pubsublite_v1/services/cursor_service/transports/grpc.py b/google/cloud/pubsublite_v1/services/cursor_service/transports/grpc.py index f02f5d32..f64703c0 100644 --- a/google/cloud/pubsublite_v1/services/cursor_service/transports/grpc.py +++ b/google/cloud/pubsublite_v1/services/cursor_service/transports/grpc.py @@ -33,7 +33,7 @@ class CursorServiceGrpcTransport(CursorServiceTransport): """gRPC backend transport for CursorService. The service that a subscriber client application uses to - manage committed cursors while receiving messsages. A cursor + manage committed cursors while receiving messages. A cursor represents a subscriber's progress within a topic partition for a given subscription. diff --git a/google/cloud/pubsublite_v1/services/cursor_service/transports/grpc_asyncio.py b/google/cloud/pubsublite_v1/services/cursor_service/transports/grpc_asyncio.py index 41d9f0aa..4c60a5cd 100644 --- a/google/cloud/pubsublite_v1/services/cursor_service/transports/grpc_asyncio.py +++ b/google/cloud/pubsublite_v1/services/cursor_service/transports/grpc_asyncio.py @@ -36,7 +36,7 @@ class CursorServiceGrpcAsyncIOTransport(CursorServiceTransport): """gRPC AsyncIO backend transport for CursorService. The service that a subscriber client application uses to - manage committed cursors while receiving messsages. A cursor + manage committed cursors while receiving messages. A cursor represents a subscriber's progress within a topic partition for a given subscription. diff --git a/samples/snippets/noxfile_config.py b/samples/snippets/noxfile_config.py index 54fb6262..f4fd67c2 100644 --- a/samples/snippets/noxfile_config.py +++ b/samples/snippets/noxfile_config.py @@ -14,7 +14,7 @@ # Default TEST_CONFIG_OVERRIDE for python repos. -# You can copy this file into your directory, then it will be inported from +# You can copy this file into your directory, then it will be imported from # the noxfile.py. # The source of truth: diff --git a/samples/snippets/publish_with_batch_settings_example.py b/samples/snippets/publish_with_batch_settings_example.py index ee3d2772..6d7db9b7 100644 --- a/samples/snippets/publish_with_batch_settings_example.py +++ b/samples/snippets/publish_with_batch_settings_example.py @@ -49,7 +49,7 @@ def publish_with_batch_settings( location = CloudZone(CloudRegion(cloud_region), zone_id) topic_path = TopicPath(project_number, location, topic_id) - batch_setttings = BatchSettings( + batch_settings = BatchSettings( # 2 MiB. Default to 3 MiB. Must be less than 4 MiB gRPC's per-message limit. max_bytes=2 * 1024 * 1024, # 100 ms. Default to 50 ms. @@ -60,7 +60,7 @@ def publish_with_batch_settings( # PublisherClient() must be used in a `with` block or have __enter__() called before use. with PublisherClient( - per_partition_batching_settings=batch_setttings + per_partition_batching_settings=batch_settings ) as publisher_client: for message in range(num_messages): data = f"{message}" diff --git a/samples/snippets/publish_with_ordering_key_example.py b/samples/snippets/publish_with_ordering_key_example.py index 2c4fbe75..1ca461a0 100644 --- a/samples/snippets/publish_with_ordering_key_example.py +++ b/samples/snippets/publish_with_ordering_key_example.py @@ -54,7 +54,7 @@ def publish_with_odering_key( for message in range(num_messages): data = f"{message}" # Messages of the same ordering key will always get published to the same partition. - # When ordering_key is unset, messsages can get published ot different partitions if + # When ordering_key is unset, messages can get published to different partitions if # more than one partition exists for the topic. api_future = publisher_client.publish( topic_path, data.encode("utf-8"), ordering_key="testing" diff --git a/samples/snippets/update_lite_topic_example.py b/samples/snippets/update_lite_topic_example.py index 89406ac4..942f3597 100644 --- a/samples/snippets/update_lite_topic_example.py +++ b/samples/snippets/update_lite_topic_example.py @@ -62,7 +62,7 @@ def update_lite_topic( "partition_config.capacity", "retention_config.per_partition_bytes", "retention_config.period", - "reservation_confing.throughput_reservation", + "reservation_config.throughput_reservation", ] ) @@ -80,7 +80,7 @@ def update_lite_topic( # If the number of byptes stored in any of the topic's partitions grows beyond # this value, older messages will be dropped to make room for newer ones, # regardless of the value of `period`. - # Be careful when decreasing storage per partition as it may cuase lost messages. + # Be careful when decreasing storage per partition as it may cause lost messages. per_partition_bytes=32 * 1024 * 1024 * 1024, # Allow messages to be stored for 14 days. period=Duration(seconds=60 * 60 * 24 * 14), From 02a312e1d96f99b2b11cdd8192d73cc75ca8e065 Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Mon, 11 Nov 2024 17:08:53 +0000 Subject: [PATCH 2/2] =?UTF-8?q?=F0=9F=A6=89=20Updates=20from=20OwlBot=20po?= =?UTF-8?q?st-processor?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --- .kokoro/test-samples-impl.sh | 2 +- .kokoro/trampoline_v2.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.kokoro/test-samples-impl.sh b/.kokoro/test-samples-impl.sh index f987b896..55910c8b 100755 --- a/.kokoro/test-samples-impl.sh +++ b/.kokoro/test-samples-impl.sh @@ -35,7 +35,7 @@ env | grep KOKORO # Install nox python3.9 -m pip install --upgrade --quiet nox -# Use secrets accessor service account to get secrets +# Use secrets acessor service account to get secrets if [[ -f "${KOKORO_GFILE_DIR}/secrets_viewer_service_account.json" ]]; then gcloud auth activate-service-account \ --key-file="${KOKORO_GFILE_DIR}/secrets_viewer_service_account.json" \ diff --git a/.kokoro/trampoline_v2.sh b/.kokoro/trampoline_v2.sh index 9ba314ef..35fa5292 100755 --- a/.kokoro/trampoline_v2.sh +++ b/.kokoro/trampoline_v2.sh @@ -391,7 +391,7 @@ docker_flags=( # Use the host network. "--network=host" - # Run in privileged mode. We are not using docker for sandboxing or + # Run in priviledged mode. We are not using docker for sandboxing or # isolation, just for packaging our dev tools. "--privileged"