GeezerVison is showing github.com — Pubsub example on front page fails if topic does not already exist · Issue #1082 · googleapis/google-cloud-python
Pubsub example on front page fails if topic does not already exist #1082DescriptionThe pubsub example throws an exception if the specified topic does not already exist. Example:
>>> from gcloud import pubsub
>>> client = pubsub.Client(project=MY_PROJECT_ID)
>>> topic = client.topic('my-new-custom-topic')
>>> topic.publish('Ping!')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python2.7/dist-packages/gcloud/pubsub/topic.py", line 186, in publish
method='POST', path='%s:publish' % (self.path,), data=data)
File "/usr/local/lib/python2.7/dist-packages/gcloud/connection.py", line 419, in api_request
error_info=method + ' ' + url)
gcloud.exceptions.NotFound: 404 Resource not found (resource=my-custom-topic). (POST https://pubsub.googleapis.com/v1/projects/lee-cloud/topics/my-custom-topic:publish)
The code sample will resume working if you create the topic and re-run the sample, but it would be nice if the code sample included a line or two demonstrating how to create a topic if it doesn't exist. Activitydhermes commented on Aug 24, 2015 Michael0x2a commented on Aug 24, 2015 theacodes commented on Aug 24, 2015 Assign this to me, Danny. I guess we need to call out specifically that
users should create their topic beforehand.
(fwiw, I don't like these samples on the python landing page...)
On Mon, Aug 24, 2015 at 4:00 PM Michael Lee [email protected]
wrote:
Whoops, sorry -- at the bottom of https://cloud.google.com/python/ if you
click "Publish messages and subscribe to Pub/Sub topics".
—
Reply to this email directly or view it on GitHub
#1082 (comment)
.
dhermes commented on Aug 24, 2015 dhermes commented on Aug 24, 2015 @jonparrott I can't assign to someone outside the org. Are you not a part of GoogleCloudPlatform? If not, why not? theacodes commented on Aug 24, 2015 I am, but our repos are divided into teams. I'm not part of the team that's
on this repo (perhaps I should be?)
On Mon, Aug 24, 2015 at 4:02 PM Danny Hermes [email protected]
wrote:
@jonparrott https://github.com/jonparrott I can't assign to someone
outside the org. Are you not a part of GoogleCloudPlatform? If not, why not?
—
Reply to this email directly or view it on GitHub
#1082 (comment)
.
dhermes commented on Aug 24, 2015 What are the implications? We can chat on Hangouts if it's easier / less public. theacodes commented on Aug 24, 2015 Nothing that I'm aware of. Summoning @elibixby who has admin rights to GoogleCloudPlatform. elibixby commented on Aug 25, 2015 Unfortunately right a team has a level of permissions, a set of repos and a set of members, and everyone on the team has the same level of permissions for all the repos of the team.... It's a really bad permissions model, and we're moving to the new one Sept 22nd, until then, make your team choice accordingly =) theacodes commented on Aug 25, 2015 I'm tracking this via an internal bug now, as it's unclear whether we should instruct new users to create projects, enable billing, etc, or just remove these code samples. dhermes commented on Aug 25, 2015 Shall I close this issue? theacodes commented on Aug 25, 2015 Sure - it's not an issue with this library.
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|