feat: add retry/timeout to manual surface#222
Conversation
1b61f49 to
e7d2119
Compare
07aa854 to
16a1e34
Compare
Methods include: - 'create' - 'set' - 'update' - 'delete' - 'get' - 'collections' Toward #221
d6e76d6 to
4e3be50
Compare
|
Updated: I just reviewed it as a whole, and think it is easier than following the commit-by-commit path. |
tseaver
left a comment
There was a problem hiding this comment.
Comments on commit-by-commit review reflecting later changes as the PR evolved.
| if timeout is not None: | ||
| kwargs["timeout"] = timeout | ||
|
|
||
| return kwargs |
There was a problem hiding this comment.
Later commits factor this method out into _helpers.make_retry_timeout_kwargs.
| retry=retry, | ||
| timeout=timeout, | ||
| metadata=client._rpc_metadata, | ||
| ) |
There was a problem hiding this comment.
40fae96 removes most of the redundancy in the tests for Client.get_all.
| timeout=timeout, | ||
| metadata=client._rpc_metadata, | ||
| ) | ||
|
|
There was a problem hiding this comment.
bad75e1 factors out the redundancy in the tests for Client.collections.
| kwargs["retry"] = retry | ||
|
|
||
| if timeout is not None: | ||
| kwargs["timeout"] = timeout |
There was a problem hiding this comment.
Since factored out to use _helpers.make_retry_timeout_kwargs.
| kwargs["retry"] = retry | ||
|
|
||
| if timeout is not None: | ||
| kwargs["timeout"] = timeout |
There was a problem hiding this comment.
Likewise, later commits update to use the helper here.
| kwargs["retry"] = retry | ||
|
|
||
| if timeout is not None: | ||
| kwargs["timeout"] = timeout |
There was a problem hiding this comment.
Factored out later to use the helper.
| kwargs["retry"] = retry | ||
|
|
||
| if timeout is not None: | ||
| kwargs["timeout"] = timeout |
There was a problem hiding this comment.
Factored out later to use the helper.
| kwargs["retry"] = retry | ||
|
|
||
| if timeout is not None: | ||
| kwargs["timeout"] = timeout |
There was a problem hiding this comment.
Factored out later to use the helper.
| for i in iterator.collection_ids: | ||
| yield self.collection(i) | ||
| if iterator.next_page_token: | ||
| next_request = request.cpoy() |
| for i in iterator.collection_ids: | ||
| yield self.collection(i) | ||
| if iterator.next_page_token: | ||
| next_request = request.cpoy() |
| firestore_api.list_collection_ids.return_value = iterator | ||
|
|
||
| collections = [c async for c in client.collections()] | ||
| collections = [c async for c in client.collections(**kwargs)] |
There was a problem hiding this comment.
just confirming, you have added these changes to a few tests to get complete coverage? The changes of this PR shouldn't result in any required changes to users correct?
There was a problem hiding this comment.
Right. See test_collections and test_collections_w_retry_timeout below.
Allows user to pass explicit 'retry=None' to suppress retries.
Base Classes
base_client.BaseClient.collections(signature only)base_client.BaseClient.get_all(signature only)base_collection.BaseCollectionReference.add(signature only)base_collection.BaseCollectionReference.get(signature only)base_collection.BaseCollectionReference.list_documents(signature only)base_collection.BaseCollectionReference.stream(signature only)base_document.BaseDocumentReference.collections(signature only)base_document.BaseDocumentReference.create(signature only)base_document.BaseDocumentReference.delete(signature only)base_document.BaseDocumentReference.get(signature only)base_document.BaseDocumentReference.set(signature only)base_document.BaseDocumentReference.update(signature only)base_query.BaseCollectionGroup.get_partitions(signature only)base_query.BaseQuery.get(signature only)base_query.BaseQuery.stream(signature only)base_transaction.BaseTransaction.get(signature only)base_transaction.BaseTransaction.get_all(signature only)Synchronous
batch.Batch.commitclient.Client.collectionsclient.Client.get_allcollection.Collection.addcollection.Collection.getcollection.Collection.list_documentscollection.Collection.streamdocument.Document.collectionsdocument.Document.createdocument.Document.deletedocument.Document.getdocument.Document.setdocument.Document.updatequery.CollectionGroup.get_partitionsquery.Query.getquery.Query.streamtransaction.Transaction.gettransaction.Transaction.get_allAsynchronous
async_batch.AsyncBatch.commitasync_client.AsyncClient.collectionsasync_client.AsyncClient.get_allasync_collection.AsyncCollection.addasync_collection.AsyncCollection.getasync_collection.AsyncCollection.list_documentsasync_collection.AsyncCollection.streamasync_document.AsyncDocument.collectionsasync_document.AsyncDocument.createasync_document.AsyncDocument.deleteasync_document.AsyncDocument.getasync_document.AsyncDocument.setasync_document.AsyncDocument.updateasync_query.AsyncCollectionGroup.get_partitionsasync_query.AsyncQuery.getasync_query.AsyncQuery.streamasync_transaction.AsyncTransaction.getasync_transaction.AsyncTransaction.get_allUnsure
base_collection.BaseCollection.on_snapshot(signature only)base_document.BaseDocumentRef.on_snapshot(signature only)base_query.BaseQuery.on_snapshot(signature only)collection.Collection.on_snapshotdocument.Document.on_snapshotquery.Query.on_snapshotwatch.Watch.__init__watch.Watch.for_documentwatch.Watch.for_queryCloses #221