-
Notifications
You must be signed in to change notification settings - Fork 110
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PYCBC-804, PYCBC-655: Complete the FTS interface for SDK3
Motivation ---------- We need to migrate the SDK2 search functionality to SDK3, so it runs from the cluster. Changes ------- Added sdk-testcases, TODO - download these from git, but maybe pinned to a given revision. Refactored to SDK3, encapsulating the Params class, now only for internal use and called _Params. Results ------- All new and old tests pass. Change-Id: I6feba3daab84e611f992af90506ed607665af22d Reviewed-on: http://review.couchbase.org/c/couchbase-python-client/+/120468 Tested-by: Ellis Breen <ellis.breen@couchbase.com> Tested-by: Build Bot <build@couchbase.com> Reviewed-by: David Kelly <davidmichaelkelly@gmail.com>
- Loading branch information
1 parent
ef37d58
commit b36c711
Showing
53 changed files
with
26,940 additions
and
1,021 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
from typing import Union, Iterable, Any | ||
|
||
from couchbase_core import StopAsyncIteration | ||
|
||
IterableQuery = Iterable[Any] | ||
|
||
|
||
class IterableWrapper(object): | ||
def __init__(self, | ||
parent # type: IterableQuery | ||
): | ||
self.done = False | ||
self.buffered_rows = [] | ||
self.parent = parent # type: IterableQuery | ||
|
||
def metadata(self): | ||
# type: (...) -> JSON | ||
return self.parent.meta | ||
|
||
def __iter__(self): | ||
for row in self.buffered_rows: | ||
yield row | ||
parent_iter = iter(self.parent) | ||
while not self.done: | ||
try: | ||
next_item = next(parent_iter) | ||
self.buffered_rows.append(next_item) | ||
yield next_item | ||
except (StopAsyncIteration, StopIteration) as e: | ||
self.done = True | ||
break |
Oops, something went wrong.