-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Closed
Labels
api: pubsubIssues related to the Pub/Sub API.Issues related to the Pub/Sub API.
Description
When running locally with gcloud auth
providing application default credentials, pubsub is unable to infer a connection, so this will fail:
import pubsub
pubsub.set_default_project('my-project-id')
topic = pubsub.Topic('my-topic')
topic.publish(...)
with EnvironmentError: Connection could not be inferred.
The fix is to set an explicit connection using adc:
credentials = GoogleCredentials.get_application_default()
pubsub.set_default_connection(pubsub.Connection(credentials))
However, storage and datastore do not have this issue. It seems unnecessarily to do this just for pubsub.
Metadata
Metadata
Assignees
Labels
api: pubsubIssues related to the Pub/Sub API.Issues related to the Pub/Sub API.