Skip to content

Pubsub: Raise ValueError for message bytesize too big for batch - #4872

Merged
theacodes merged 2 commits into
googleapis:masterfrom
chemelnucfin:pubsub_raise_error_max_bytes
Feb 13, 2018
Merged

theacodes merged 2 commits into
googleapis:masterfrom
chemelnucfin:pubsub_raise_error_max_bytes

Conversation

@chemelnucfin

@chemelnucfin chemelnucfin commented Feb 12, 2018 •

Copy link
Copy Markdown
Contributor

No description provided.

@chemelnucfin chemelnucfin added type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. api: pubsub Issues related to the Pub/Sub API. labels Feb 12, 2018
@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Feb 12, 2018
message = types.PubsubMessage(data=data, attributes=attrs)
if message.ByteSize() > self.batch_settings.max_bytes:
raise ValueError('Message being published is too large for the '
'batch settings with max bytes {}.'.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

Comment thread pubsub/tests/system.py Outdated
assert isinstance(result, six.string_types)


def test_publish_max_bytes(publisher, topic_path, cleanup):

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

client.publish(topic, 42)


def test_publish_data_too_large():

This comment was marked as spam.

This comment was marked as spam.

@chemelnucfin

Copy link
Copy Markdown
Contributor Author

@jonparrott PTAL, thanks.

@theacodes

Copy link
Copy Markdown
Contributor

@chemelnucfin the CI failure here seems unrelated, so feel free to merge - but, could you send a follow-up PR to fix that?

@chemelnucfin
chemelnucfin force-pushed the pubsub_raise_error_max_bytes branch from 7da9574 to b688939 Compare February 12, 2018 22:12
@chemelnucfin

Copy link
Copy Markdown
Contributor Author

@dpebot merge on green

@dpebot

dpebot commented Feb 12, 2018

Copy link
Copy Markdown
Contributor

Okay! I'll merge when all statuses are green and all reviewers approve.

@dpebot dpebot added the automerge Merge the pull request once unit tests and other checks pass. label Feb 12, 2018
@dpebot dpebot assigned dpebot and unassigned theacodes and chemelnucfin Feb 12, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api: pubsub Issues related to the Pub/Sub API. automerge Merge the pull request once unit tests and other checks pass. cla: yes This human has signed the Contributor License Agreement. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants