Skip to content

Pub/Sub MergeFrom error publish message #5903

@paulorcf

Description

@paulorcf

🏷 pub/sub
SO: Linux/Ubuntu 16.04
api_core_version = 1.3.0
client_library_version = None
gapic_version = 0.37.2
grpc_version = 1.14.2
python_version = 3.6.4

client = pubsub.PublisherClient.from_service_account_json('account.json')
topic_path = client.topic_path('project_name', 'topic_name')
data = b'The rain in Wales falls mainly on the snails.'
response = client.publish(topic, data)

Version: google-cloud-pubsub==0.37.2

Error:

response = client.publish(topic_path, data) File "venvpy/lib/python3.6/site-packages/google/cloud/pubsub_v1/gapic/publisher_client.py", line 393, in publish messages=messages, TypeError: Parameter to MergeFrom() must be instance of same class: expected google.pubsub.v1.PubsubMessage got int.

Metadata

Metadata

Assignees

Labels

api: clouddebuggerIssues related to the Cloud Debugger API.api: pubsubIssues related to the Pub/Sub API.priority: p2Moderately-important priority. Fix may not be included in next release.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions