aboutsummaryrefslogtreecommitdiff
path: root/tests
AgeCommit message (Collapse)Author
2021-06-02feat: HTTPIterator now accepts a page_size parameter to control page … (#197)Jim Fulton
2021-05-20fix: require google-auth>=1.25.0 (#190)Bu Sun Kim
2021-05-17feat: Add support for `rest/` token in `x-goog-api-client` header (#189)Vadym Matsishevskyi
2021-05-03feat: retry google.auth TransportError and requests ConnectionError (#178)Anthonios Partheniou
Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly: - [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) Fixes #176 🦕
2021-03-31Fix retry.with_delay multiplier parameter handling (#164)Quentin Sommer
Issue: https://github.com/googleapis/python-api-core/issues/163
2021-03-25fix: skip empty policy bindings in `len()` and `iter()` (#159)Bu Sun Kim
Exclude empty policy bindings (bindings with no members) in `Policy.__iter__()` and `Policy.__len__()` Follow up to #155
2021-03-23fix: save empty IAM policy bindings (#155)Bu Sun Kim
2021-02-12fix: add operation name to x-goog-request-params in async client (#137)Bu Sun Kim
Pass the operation name in the `x-goog-request-params`header. Same as #133 for the async operations client.
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.
2021-01-25fix: add operation name to x-goog-request-params (#133)Bu Sun Kim
2021-01-14feat: allow gRPC metadata to be passed to operations client (#127)Bu Sun Kim
2020-12-14fix: support 'retry' for ops built from HTTP/gRPC responses (#115)Tres Seaver
Closes #87.
2020-10-16feat(api-core): pass retry from result() to done() (#9)Ilya Gurov
Towards: https://github.com/googleapis/python-bigquery/issues/24
2020-10-06fix: map LRO errors to library exception types (#86)Bu Sun Kim
Fixes #15 🦕 Errors raised by long running operations are currently always type GoogleAPICallError. Use the status code to create a more specific exception type.
2020-09-03fix: only add quota project id if supported (#75)arithmetic1728
2020-07-21fix: _determine_timeout problem handling float type timeout (#64)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-06-04feat(client_options): add new client options 'quota_project_id', 'scopes', ↵Dov Shlachter
and 'credentials_file' Co-authored-by: Bu Sun Kim <8822365+busunkim96@users.noreply.github.com>
2020-06-04feat: third batch of AsyncIO integration (#29)Lidi Zheng
* LRO client * gRPC wrappers & helpers * With unit tests & docs
2020-06-02feat: AsyncIO Integration [Part 2] (#28)Lidi Zheng
Children PR of https://github.com/googleapis/python-api-core/pull/26. This PR includes AsyncIO version of: * Polling future * Page iterator The AsyncIO version of polling future still uses the same mechanism as the sync version. The AsyncIO polling future tries to update its own state whenever the application want to access information or perform actions. For page iterator, it has similar interface design as sync version. But instead of fulfilling normal generator protocol, it is based on the async generator. Related #23
2020-05-28feat: [CBT-6 helper] Exposing Retry._deadline as a property (#20)MF2199
* Retry._deadline exposed as a property * feat Retry._deadline exposed as a property * added property test Co-authored-by: q-logic <52290913+q-logic@users.noreply.github.com> Co-authored-by: Christopher Wilcox <crwilcox@google.com>
2020-05-27feat: add client_encryped_cert_source to ClientOptions (#31)arithmetic1728
2020-05-26feat: First batch of AIO integration (#26)Lidi Zheng
This change includes: * Nox configuration support for AsynciO unit tests * No pre release gRPC Python required * AsyncIO retry module * AsyncIO config parsing module * Exception parsing patch * Corresponding unit test cases
2020-04-14feat(api-core): add client_cert_source to ClientOptions (#17)arithmetic1728
* feat(api-core): add client_cert_source to ClientOptions * Update google/api_core/client_options.py Co-Authored-By: Bu Sun Kim <8822365+busunkim96@users.noreply.github.com> * bump google-auth version * update noxfile.py to fix docs problem Co-authored-by: Bu Sun Kim <8822365+busunkim96@users.noreply.github.com>
2020-01-30fix: consume part of StreamingResponseIterator to support failure while ↵Christopher Wilcox
under a retry context (#10206)
2020-01-24feat(api_core): add retry param into PollingFuture() and it's inheritors (#9923)Gurov Ilya
* feat(api_core): add retry param into PollingFuture() and it's inheritors Towards #6197
2020-01-09feat(api_core): support version 3 policy bindings (#9869)Jonathan Lui
* feat(api_core): support version 3 policy bindings * fix(doc): fix documenting bindings structure * try fixing docs * fix pytype error * fill test coverage * indent docs * fix docs * improve test coverage * linty * remove unused variable
2019-12-10feat(api_core): make the last retry happen at deadline (#9873)Peter Lamut
* feat(api_core): allow setting Retry deadline as strict If a deadline is set as strict, Retry will shorten the last sleep period to end at the given deadline, and not possibly stretch beyond it. * feat(core): make the last retry happen at deadline This commit changes Retry instances in a way that the last sleep period is shortened so that its end matches at the given deadline. This prevents the last sleep period to last way beyond the deadline.
2019-11-19Add a repr method for ClientOptions (#9849)Dov Shlachter
2019-11-13feat(api core): simplify from_rfc3339 methods (#9641)Leonid Emar-Kar
2019-11-01feat(api_core): provide a 'raw_page' field for page_iterator.Page (#9486)Dov Shlachter
* Provide a 'raw_page' field for page_iterator.Page Some paginated response messages include additional fields that users may wish to inspect.
2019-10-02fix(api_core): finalize during close of 'ResumableBidiRpc' (#9337)Tres Seaver
Avoid blocking for ill-behaved daemon threads during BiDi shutdown. Closes #8616, #9008.
2019-08-22API Core: Retry.__init__ add on_error (#8892)Leonid Emar-Kar
2019-07-23Forward 'timeout' arg from 'exception' to '_blocking_poll'. (#8735)Tres Seaver
Closes #8733.
2019-07-17Firestore: Add 'should_terminate' predicate for clean BiDi shutdown. (#8650)Tres Seaver
Closes #7826.
2019-06-24Add client options. (#8265)Bu Sun Kim
2019-06-18Core: Mitigate busy reopen loop in ResumableBidiRpc consuming 100% CPU (#8193)Peter Lamut
* Add bidi._Throttle helper class * Add optional reopen throttling to ResumableBidiRpc * Enable Bidi reopen throttling in SPM * Change bidi._Throttle signature The commit renames the entry_cap parameter to access_limit, and changes the type of the time_window argument from float to timedelta.
2019-05-28Core: Classify 503 Service Unavailable errors as transient. (#8182)Tres Seaver
Also, pin grpcio < 2.0dev. Closes #5410.
2019-05-20Add parameterized test for from_rfc3339 with nanos (#7675)Christopher Wilcox
* Add parameterized test for from_rfc3339 with nanos
2019-05-07Refactor 'client_info' support. (#7849)Tres Seaver
* Add 'user_agent' and 'extra_headers' properties to 'Connection'. Deprecate the 'USER_AGENT' and '_EXTRA_HEADERS' class-level attributes. * Add 'client_info' parameter to 'Connection' ctor. * Implement 'Connection.user_agent' via its '_client_info'. * Ensure 'X-Goog-API-Client' header is always passed. * Create/use non-GAPIC-specific 'ClientInfo' class FBO HTTP/JSON clients. Derive the existing GAPIC class from it.
2019-04-29Add `user_agent` property to `ClientInfo` (#7799)Tim Swast
* Add `user_agent` property to `ClientInfo` This provides a way for partners to define a prefix identifying their tool or application, as required by many cloud partnership agreements. * Workaround for pytype pyi error with nested class.
2019-04-07Append leading zeros for nanosecond precision DateTimes (#7663)gleeper
2019-03-27Allow passing metadata as part of creating a bidi (#7514)Christopher Wilcox
* allows providing rpc metadata for bidi streams
2019-02-23Add support to unwrap Anys into wrapped pb2 objects. (#7430)Luke Sneeringer
This commit adds support for unwrapping wrapped pb2 objects from Anys (needed for LRO support with wrapping).
2019-02-23Add `Operation.deserialize`. (#7427)Luke Sneeringer
This commit adds a `deserialize` method to the Operation object. The class method is a helper to deserialize the serialized protobuf operation messages.
2019-02-19Fix new lint failure. (#7382)Tres Seaver
F632 use ==/!= to compare str, bytes, and int literals.
2018-12-13Api_core: Convert 'DatetimeWithNanos' to / from ↵Tres Seaver
'google.protobuf.timestamp_pb2.Timestamp' (#6919) Toward #6547.
2018-12-07API Core: fix pytype build (#6873)Tres Seaver
* Run 'pytype' only over the 'google/' directory. * Ignore 'pytype_output/' derived files. * Remove spurious 'MutableMapping.register' call. 'pytype' chokes on it, but the 'Policy' class already derives from 'MutableMapping', so the call is a no-op. * Silence deprecation spew during IAM unit tests.