Skip to content

Commit 0248095

Browse files
author
Chris Rossi
authored
Implement query iterators. (#74)
Query fetch has been refactored to work on top of query iterators.
1 parent 8e791ca commit 0248095

File tree

7 files changed

+1401
-548
lines changed

7 files changed

+1401
-548
lines changed

packages/google-cloud-ndb/MIGRATION_NOTES.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,12 @@ The primary differences come from:
156156
- The `batch_size` and `prefetch_size` arguments to `Query.fetch` and
157157
`Query.fetch_async` are no longer supported. These were passed through
158158
directly to Datastore, which no longer supports these options.
159+
- The `index_list` method of `QueryIterator` is not implemented. Datastore no
160+
longer returns this data with query results, so it is not available from the
161+
API in this way.
162+
- The `produce_cursors` query option is deprecated. Datastore always returns
163+
cursors, where it can, and NDB always makes them available when possible.
164+
This option can be passed in but it will be ignored.
159165

160166
## Privatization
161167

packages/google-cloud-ndb/src/google/cloud/ndb/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,8 @@
131131
from google.cloud.ndb.context import TransactionOptions
132132
from google.cloud.ndb._datastore_api import EVENTUAL
133133
from google.cloud.ndb._datastore_api import EVENTUAL_CONSISTENCY
134+
from google.cloud.ndb._datastore_query import Cursor
135+
from google.cloud.ndb._datastore_query import QueryIterator
134136
from google.cloud.ndb.key import Key
135137
from google.cloud.ndb.model import BlobKey
136138
from google.cloud.ndb.model import BlobKeyProperty
@@ -188,7 +190,6 @@
188190
from google.cloud.ndb.model import UserProperty
189191
from google.cloud.ndb.query import ConjunctionNode
190192
from google.cloud.ndb.query import AND
191-
from google.cloud.ndb.query import Cursor
192193
from google.cloud.ndb.query import DisjunctionNode
193194
from google.cloud.ndb.query import OR
194195
from google.cloud.ndb.query import FalseNode
@@ -201,7 +202,6 @@
201202
from google.cloud.ndb.query import ParameterNode
202203
from google.cloud.ndb.query import PostFilterNode
203204
from google.cloud.ndb.query import Query
204-
from google.cloud.ndb.query import QueryIterator
205205
from google.cloud.ndb.query import QueryOptions
206206
from google.cloud.ndb.query import RepeatedStructuredPropertyPredicate
207207
from google.cloud.ndb.tasklets import add_flow_exception

0 commit comments

Comments
 (0)