Title: Using google.cloud.operation for GAPIC Speech async? · Issue #2629 · googleapis/google-cloud-python · GitHub
Open Graph Title: Using google.cloud.operation for GAPIC Speech async? · Issue #2629 · googleapis/google-cloud-python
X Title: Using google.cloud.operation for GAPIC Speech async? · Issue #2629 · googleapis/google-cloud-python
Description: I've been struggling today with the right way to implement this. I can't seem to make_secure_stub for speech. This is the error I get... File "/Users/daspecster/Documents/google/google-cloud-py-2/.tox/py27/lib/python2.7/site-packages/goo...
Open Graph Description: I've been struggling today with the right way to implement this. I can't seem to make_secure_stub for speech. This is the error I get... File "/Users/daspecster/Documents/google/google-cloud-py-2/....
X Description: I've been struggling today with the right way to implement this. I can't seem to make_secure_stub for speech. This is the error I get... File "/Users/daspecster/Documents/google/google...
Opengraph URL: https://github.com/googleapis/google-cloud-python/issues/2629
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Using google.cloud.operation for GAPIC Speech async?","articleBody":"I've been struggling today with the right way to implement this.\nI can't seem to `make_secure_stub` for speech.\n\nThis is the error I get...\n\n```\nFile \"/Users/daspecster/Documents/google/google-cloud-py-2/.tox/py27/lib/python2.7/site-packages/google_cloud_speech-0.20.0.dev0-py2.7.egg/google/cloud/speech/_gax.py\", line 92, in async_recognize\n OPERATIONS_API_HOST)\n File \"/Users/daspecster/Documents/google/google-cloud-py-2/.tox/py27/lib/python2.7/site-packages/google_cloud_core-0.20.0-py2.7.egg/google/cloud/_helpers.py\", line 642, in make_secure_stub\n transport_creds = grpc.ssl_channel_credentials()\nAttributeError: 'module' object has no attribute 'ssl_channel_credentials'\n```\n\nExample code:\n\n``` python\n config = RecognitionConfig(\n encoding=sample.encoding, sample_rate=sample.sample_rate,\n language_code=language_code, max_alternatives=max_alternatives,\n profanity_filter=profanity_filter,\n speech_context=SpeechContext(phrases=speech_context))\n\n audio = RecognitionAudio(content=sample.content,\n uri=sample.source_uri)\n self._client._operations_stub = make_secure_stub(\n self._client.connection.credentials,\n DEFAULT_USER_AGENT,\n operations_grpc.OperationsStub,\n OPERATIONS_API_HOST)\n\n api = self._gapic_api\n operation = api.sync_recognize(config=config, audio=audio)\n return Operation.from_pb(operation, self._client)\n```\n\nLooking at the [sample example](https://github.com/GoogleCloudPlatform/python-docs-samples/blob/2da1c09b056798dd54be7106010f9d5610952bef/speech/grpc/transcribe_async.py#L32-L51) it seems like the channel creation is different than it is in our [`_helpers.make_secure_stub`](https://github.com/GoogleCloudPlatform/google-cloud-python/blob/b2662c1ac0e91b4c2193f4ac0b929aa957b8cfc4/core/google/cloud/_helpers.py#L620)\n","author":{"url":"https://github.com/daspecster","@type":"Person","name":"daspecster"},"datePublished":"2016-10-27T02:22:04.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":6},"url":"https://github.com/2629/google-cloud-python/issues/2629"}
| 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:737507d0-629a-4b7c-88ed-8566c9f1a52f |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E54C:2D33C5:1914E6:221C3A:6A4D8608 |
| html-safe-nonce | bb6beacc38216708b738a584279b1c606c72b2f2cf63efc3f7f962c487692ba4 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFNTRDOjJEMzNDNToxOTE0RTY6MjIxQzNBOjZBNEQ4NjA4IiwidmlzaXRvcl9pZCI6IjI0NjA5MzE1OTU3MDExNTk0MzIiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 14781018c7a787d2305489671d80dfa5dc63f52aab3036dab485eeb9a692b985 |
| hovercard-subject-tag | issue:185557347 |
| 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/2629/issue_layout |
| twitter:image | https://opengraph.githubassets.com/835d94edaa73b95f0fb541640502241bb2b29cbc6052f54758d994cf4daab2e5/googleapis/google-cloud-python/issues/2629 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/835d94edaa73b95f0fb541640502241bb2b29cbc6052f54758d994cf4daab2e5/googleapis/google-cloud-python/issues/2629 |
| og:image:alt | I've been struggling today with the right way to implement this. I can't seem to make_secure_stub for speech. This is the error I get... File "/Users/daspecster/Documents/google/google-cloud-py-2/.... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | daspecster |
| hostname | github.com |
| expected-hostname | github.com |
| None | c6bf61c909482ec3072ef5d7a5a28f2a9d214788c9a44793eca1960048cb05ae |
| 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 | 6702a58b419a792226bd21ef0fb1bcb318bbcaa3 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width