Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions google/cloud/pubsublite/cloudpubsub/message_transforms.py
Original file line number Diff line number Diff line change
Expand Up @@ -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."
)


Expand Down Expand Up @@ -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."
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
2 changes: 1 addition & 1 deletion samples/snippets/noxfile_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
4 changes: 2 additions & 2 deletions samples/snippets/publish_with_batch_settings_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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}"
Expand Down
2 changes: 1 addition & 1 deletion samples/snippets/publish_with_ordering_key_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 2 additions & 2 deletions samples/snippets/update_lite_topic_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
]
)

Expand All @@ -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),
Expand Down