Skip to content

Commit

Permalink
Change 'BatchSettings.max_bytes' default. (#5899)
Browse files Browse the repository at this point in the history
It is documented as '10MB', but enforced as 10000000 bytes.

Closes #5898.
  • Loading branch information
tseaver authored Sep 7, 2018
1 parent e7f43ec commit cbf90ec
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pubsub/google/cloud/pubsub_v1/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
['max_bytes', 'max_latency', 'max_messages'],
)
BatchSettings.__new__.__defaults__ = (
1024 * 1024 * 10, # max_bytes: 10 MB
1000 * 1000 * 10, # max_bytes: documented "10 MB", enforced 10000000
0.05, # max_latency: 0.05 seconds
1000, # max_messages: 1,000
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def test_init():
# A plain client should have an `api` (the underlying GAPIC) and a
# batch settings object, which should have the defaults.
assert isinstance(client.api, publisher_client.PublisherClient)
assert client.batch_settings.max_bytes == 10 * (2 ** 20)
assert client.batch_settings.max_bytes == 10 * 1000 * 1000
assert client.batch_settings.max_latency == 0.05
assert client.batch_settings.max_messages == 1000

Expand Down

0 comments on commit cbf90ec

Please sign in to comment.