Title: pubsub can't infer a connection when running locally. · Issue #916 · googleapis/google-cloud-python · GitHub
Open Graph Title: pubsub can't infer a connection when running locally. · Issue #916 · googleapis/google-cloud-python
X Title: pubsub can't infer a connection when running locally. · Issue #916 · googleapis/google-cloud-python
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....
Open Graph 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')...
X 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-...
Opengraph URL: https://github.com/googleapis/google-cloud-python/issues/916
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"pubsub can't infer a connection when running locally.","articleBody":"When running locally with `gcloud auth` providing application default credentials, pubsub is unable to infer a connection, so this will fail:\n\n``` python\nimport pubsub\npubsub.set_default_project('my-project-id')\ntopic = pubsub.Topic('my-topic')\ntopic.publish(...)\n```\n\nwith `EnvironmentError: Connection could not be inferred.`\n\nThe fix is to set an explicit connection using adc:\n\n``` python\ncredentials = GoogleCredentials.get_application_default()\npubsub.set_default_connection(pubsub.Connection(credentials))\n```\n\nHowever, storage and datastore do not have this issue. It seems unnecessarily to do this just for pubsub.\n","author":{"url":"https://github.com/theacodes","@type":"Person","name":"theacodes"},"datePublished":"2015-06-08T17:41:13.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":5},"url":"https://github.com/916/google-cloud-python/issues/916"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:f048f4dd-97c9-c112-35b1-734b1f2136bc |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | DD30:3B44D:03DD:04D1:6A4D8E31 |
| html-safe-nonce | 0a5fa0ce9b30be973fb0fd6e7fd2f5c6a8f3d773d23e5957fb72a7e17e2eb271 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJERDMwOjNCNDREOjAzREQ6MDREMTo2QTREOEUzMSIsInZpc2l0b3JfaWQiOiIzNjgwNjk2MDU4NTg3NzQ1ODQxIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | cd2fd199ae28437fe10bb3c90c1f2e943877a0b2f4ed47e8ddaab56e6512e1bf |
| hovercard-subject-tag | issue:86269587 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/googleapis/google-cloud-python/916/issue_layout |
| twitter:image | https://opengraph.githubassets.com/44c1ea62ffe5fc1ae685ba48dab5781ff7f46018dca2d84a2681cd3067759b27/googleapis/google-cloud-python/issues/916 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/44c1ea62ffe5fc1ae685ba48dab5781ff7f46018dca2d84a2681cd3067759b27/googleapis/google-cloud-python/issues/916 |
| og:image:alt | 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')... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | theacodes |
| hostname | github.com |
| expected-hostname | github.com |
| None | 9f8758a3953dfe943439713a6fa4f90d542a3431f10e861ca03dd7f39009f320 |
| turbo-cache-control | no-preview |
| go-import | github.com/googleapis/google-cloud-python git https://github.com/googleapis/google-cloud-python.git |
| octolytics-dimension-user_id | 16785467 |
| octolytics-dimension-user_login | googleapis |
| octolytics-dimension-repository_id | 16316451 |
| octolytics-dimension-repository_nwo | googleapis/google-cloud-python |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 16316451 |
| octolytics-dimension-repository_network_root_nwo | googleapis/google-cloud-python |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | bffd5484f01713a661b03469b77678f72b6574ed |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width