From 7228f6c9a4c050bf22bb4bc3582b89b04eaa8702 Mon Sep 17 00:00:00 2001 From: Ryan Yuan Date: Tue, 29 Sep 2020 07:25:34 +1000 Subject: [PATCH] docs: fix get topic_path in subscriber sample (#210) --- docs/subscriber/index.rst | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/docs/subscriber/index.rst b/docs/subscriber/index.rst index bfd2fff26..2c9fd91ce 100644 --- a/docs/subscriber/index.rst +++ b/docs/subscriber/index.rst @@ -36,8 +36,12 @@ to subscribe to, and it must already exist. Once you have that, it is easy: # Substitute PROJECT, SUBSCRIPTION, and TOPIC with appropriate values for # your application. + + # from google.cloud import pubsub + # publisher = pubsub.PublisherClient() + + topic_path = publisher.topic_path(PROJECT, TOPIC) sub_path = subscriber.subscription_path(PROJECT, SUBSCRIPTION) - topic_path = subscriber.topic_path(PROJECT, TOPIC) subscriber.create_subscription(request={"name": sub_path, "topic": topic_path}) Once you have created a subscription (or if you already had one), the next