We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d66a2ef commit 128d7e8Copy full SHA for 128d7e8
quixstreams/state/rocksdb/partition.py
@@ -174,12 +174,17 @@ def iter_items(
174
175
if not backwards:
176
# NOTE: Forward iteration respects bounds correctly.
177
- return items
+ # Also, we need to use yield from notation to replace RdictItems
178
+ # with Python-native generator or else garbage collection
179
+ # will make the result unpredictable.
180
+ yield from items
181
else:
182
# NOTE: When iterating backwards, the `read_opt` lower bound
183
# is not respected by Rdict for some reason. We need to manually
184
# filter it here.
- return ((key, value) for key, value in items if lower_bound <= key)
185
+ for key, value in items:
186
+ if lower_bound <= key:
187
+ yield (key, value)
188
189
def exists(self, key: bytes, cf_name: str = "default") -> bool:
190
"""
0 commit comments