From 7e8481db84a6d0b96cf09c38e90f47d6b7847a0b Mon Sep 17 00:00:00 2001 From: Jim Morrison Date: Mon, 26 Feb 2024 20:55:34 -0800 Subject: [PATCH] docs: Correct read_consistency docs. (#948) --- google/cloud/ndb/query.py | 56 +++++++++++++++------------------------ 1 file changed, 21 insertions(+), 35 deletions(-) diff --git a/google/cloud/ndb/query.py b/google/cloud/ndb/query.py index 65b8f140..6a599630 100644 --- a/google/cloud/ndb/query.py +++ b/google/cloud/ndb/query.py @@ -1742,11 +1742,9 @@ def fetch(self, limit=None, **kwargs): end_cursor: Endpoint point for search. timeout (Optional[int]): Override the gRPC timeout, in seconds. deadline (Optional[int]): DEPRECATED: Synonym for ``timeout``. - read_consistency: If not in a transaction, defaults to - ``ndb.EVENTUAL`` for potentially faster query results without - having to wait for Datastore to apply pending changes to all - returned records. Otherwise consistency with current - transaction is maintained. + read_consistency: If set then passes the explicit read consistency to + the server. May not be set to ``ndb.EVENTUAL`` when a transaction + is specified. read_policy: DEPRECATED: Synonym for ``read_consistency``. transaction (bytes): Transaction ID to use for query. Results will be consistent with Datastore state for that transaction. @@ -1795,11 +1793,9 @@ def fetch_async(self, limit=None, **kwargs): end_cursor: Endpoint point for search. timeout (Optional[int]): Override the gRPC timeout, in seconds. deadline (Optional[int]): DEPRECATED: Synonym for ``timeout``. - read_consistency: If not in a transaction, defaults to - ``ndb.EVENTUAL`` for potentially faster query results without - having to wait for Datastore to apply pending changes to all - returned records. Otherwise consistency with current - transaction is maintained. + read_consistency: If set then passes the explicit read consistency to + the server. May not be set to ``ndb.EVENTUAL`` when a transaction + is specified. read_policy: DEPRECATED: Synonym for ``read_consistency``. transaction (bytes): Transaction ID to use for query. Results will be consistent with Datastore state for that transaction. @@ -1897,11 +1893,9 @@ def iter(self, **kwargs): end_cursor: Endpoint point for search. timeout (Optional[int]): Override the gRPC timeout, in seconds. deadline (Optional[int]): DEPRECATED: Synonym for ``timeout``. - read_consistency: If not in a transaction, defaults to - ``ndb.EVENTUAL`` for potentially faster query results without - having to wait for Datastore to apply pending changes to all - returned records. Otherwise consistency with current - transaction is maintained. + read_consistency: If set then passes the explicit read consistency to + the server. May not be set to ``ndb.EVENTUAL`` when a transaction + is specified. read_policy: DEPRECATED: Synonym for ``read_consistency``. transaction (bytes): Transaction ID to use for query. Results will be consistent with Datastore state for that transaction. @@ -1960,11 +1954,9 @@ def map(self, callback, **kwargs): end_cursor: Endpoint point for search. timeout (Optional[int]): Override the gRPC timeout, in seconds. deadline (Optional[int]): DEPRECATED: Synonym for ``timeout``. - read_consistency: If not in a transaction, defaults to - ``ndb.EVENTUAL`` for potentially faster query results without - having to wait for Datastore to apply pending changes to all - returned records. Otherwise consistency with current - transaction is maintained. + read_consistency: If set then passes the explicit read consistency to + the server. May not be set to ``ndb.EVENTUAL`` when a transaction + is specified. read_policy: DEPRECATED: Synonym for ``read_consistency``. transaction (bytes): Transaction ID to use for query. Results will be consistent with Datastore state for that transaction. @@ -2073,11 +2065,9 @@ def get(self, **kwargs): end_cursor: Endpoint point for search. timeout (Optional[int]): Override the gRPC timeout, in seconds. deadline (Optional[int]): DEPRECATED: Synonym for ``timeout``. - read_consistency: If not in a transaction, defaults to - ``ndb.EVENTUAL`` for potentially faster query results without - having to wait for Datastore to apply pending changes to all - returned records. Otherwise consistency with current - transaction is maintained. + read_consistency: If set then passes the explicit read consistency to + the server. May not be set to ``ndb.EVENTUAL`` when a transaction + is specified. read_policy: DEPRECATED: Synonym for ``read_consistency``. transaction (bytes): Transaction ID to use for query. Results will be consistent with Datastore state for that transaction. @@ -2178,11 +2168,9 @@ def count(self, limit=None, **kwargs): end_cursor: Endpoint point for search. timeout (Optional[int]): Override the gRPC timeout, in seconds. deadline (Optional[int]): DEPRECATED: Synonym for ``timeout``. - read_consistency: If not in a transaction, defaults to - ``ndb.EVENTUAL`` for potentially faster query results without - having to wait for Datastore to apply pending changes to all - returned records. Otherwise consistency with current - transaction is maintained. + read_consistency: If set then passes the explicit read consistency to + the server. May not be set to ``ndb.EVENTUAL`` when a transaction + is specified. read_policy: DEPRECATED: Synonym for ``read_consistency``. transaction (bytes): Transaction ID to use for query. Results will be consistent with Datastore state for that transaction. @@ -2272,11 +2260,9 @@ def fetch_page(self, page_size, **kwargs): end_cursor: Endpoint point for search. timeout (Optional[int]): Override the gRPC timeout, in seconds. deadline (Optional[int]): DEPRECATED: Synonym for ``timeout``. - read_consistency: If not in a transaction, defaults to - ``ndb.EVENTUAL`` for potentially faster query results without - having to wait for Datastore to apply pending changes to all - returned records. Otherwise consistency with current - transaction is maintained. + read_consistency: If set then passes the explicit read consistency to + the server. May not be set to ``ndb.EVENTUAL`` when a transaction + is specified. read_policy: DEPRECATED: Synonym for ``read_consistency``. transaction (bytes): Transaction ID to use for query. Results will be consistent with Datastore state for that transaction.