MCPcopy Create free account
hub / github.com/couchbase/couchbase-python-client / _get_next_row

Method _get_next_row

couchbase/views.py:67–91  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

65 return self
66
67 def _get_next_row(self):
68 if self.done_streaming is True:
69 return
70
71 try:
72 row = next(self._streaming_result)
73 except StopIteration:
74 # @TODO: PYCBC-1524
75 row = next(self._streaming_result)
76
77 if isinstance(row, PycbcCoreException):
78 raise ErrorMapper.build_exception(row)
79 # should only be None one query request is complete and _no_ errors found
80 if row is None:
81 raise StopIteration
82
83 # TODO: until streaming, a dict is returned, no deserializing...
84 # deserialized_row = self.serializer.deserialize(row)
85 deserialized_row = row
86 if issubclass(self.row_factory, ViewRow):
87 if hasattr(self.row_factory, 'from_json'):
88 return self.row_factory.from_json(deserialized_row)
89 return self.row_factory(**deserialized_row)
90 else:
91 return deserialized_row
92
93 def __next__(self):
94 return stream_next(self)

Callers

nothing calls this directly

Calls 2

build_exceptionMethod · 0.80
from_jsonMethod · 0.45

Tested by

no test coverage detected