aboutsummaryrefslogtreecommitdiff
path: root/tests/unit/test_grpc_helpers.py
AgeCommit message (Collapse)Author
2021-05-20fix: require google-auth>=1.25.0 (#190)Bu Sun Kim
2021-02-05feat: allow default_host and default_scopes to be passed to create_channel ↵Bu Sun Kim
(#134) Add `default_host` and `default_scopes` parameters to `create_channel` so self-signed JWTs can be used.
2020-09-03fix: only add quota project id if supported (#75)arithmetic1728
2020-07-20feat: allow quota project to be passed to create_channel (#58)Bu Sun Kim
* feat: allow quota project to be passed to create_channel * chore: update test name * chore: lint and increase auth lib version * chore: fix lint * Update setup.py
2020-06-18feat: allow credentials files to be passed for channel creation (#50)Bu Sun Kim
Co-authored-by: Dov Shlachter <dovs@google.com>
2020-06-09feat: allow disabling response stream pre-fetch (#30)Peter Lamut
Closes #25. This PR adds the ability to disable automatically pre-fetching the first item of a stream returned by `*-Stream` gRPC callables. This hook will be used in PubSub to fix the [stalled stream issue](https://github.com/googleapis/python-pubsub/issues/93), while also not affecting Firestore, since the default behavior is preserved. I realize the fix is far from ideal, but it's the least ugly among the approaches I tried, e.g. somehow passing the flag through `ResumableBidiRpc` (it's a messy rabbit hole). On the PubSub side monkeypatching the generated SubscriberClient will be needed, but it's a (relatively) clean one-liner: ```patch diff --git google/cloud/pubsub_v1/gapic/subscriber_client.py google/cloud/pubsub_v1/gapic/subscriber_client.py index e98a686..1d6c058 100644 --- google/cloud/pubsub_v1/gapic/subscriber_client.py +++ google/cloud/pubsub_v1/gapic/subscriber_client.py @@ -1169,6 +1169,8 @@ class SubscriberClient(object): default_timeout=self._method_configs["StreamingPull"].timeout, client_info=self._client_info, ) + # TODO: explain this monkeypatch! + self.transport.streaming_pull._prefetch_first_result_ = False return self._inner_api_calls["streaming_pull"]( requests, retry=retry, timeout=timeout, metadata=metadata ``` If/when we merge this, we should also release it, and then we can add `!= 1.17.0` to the `google-api-core` version pin in PubSub. ### PR checklist - [x] Make sure to open an issue as a [bug/issue](https://github.com/googleapis/python-api-core/issues/new/choose) before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea - [x] Ensure the tests and linter pass - [x] Code coverage does not decrease (if any source code was changed) - [x] Appropriate docs were updated (if necessary)
2020-01-30fix: consume part of StreamingResponseIterator to support failure while ↵Christopher Wilcox
under a retry context (#10206)
2018-11-29blacken api_core and core (#6668)Christopher Wilcox
* blacken api_core and core
2018-07-27Add support for gRPC connection management (available when using optional ↵Weiran Fang
grpc_gcp dependency) (#5553)
2018-05-16Fix tests after grpcio update (#5333)Christopher Wilcox
* Fix tests after grpcio update * add test for close stub for coverage
2018-03-06Use a class to wrap grpc streaming errors instead of monkey-patching (#4995)Jon Wayne Parrott
2018-01-05api_core: Add ChannelStub to grpc_helpers (#4705)Jon Wayne Parrott
2017-12-15Apply scopes to explicitly provided credentials if needed (#4594)Jon Wayne Parrott
2017-10-31Switch copyright holder to "Google LLC" (#4287)Luke Sneeringer
2017-10-18Add api_core package (#4210)Jon Wayne Parrott
* Add api_core package * Address review comments