Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,12 @@ def add_range(
Args:
row_range: a range of row keys to add to this query
"""
if row_range not in self.row_ranges:
# Check against a set of string signatures to avoid O(n^2) wrapper reconstruction
if not hasattr(self, "_range_signatures"):
self._range_signatures = set(str(RowRange._from_pb(r)) for r in self._row_set.row_ranges)
signature = str(row_range)
if signature not in self._range_signatures:
self._range_signatures.add(signature)
self._row_set.row_ranges.append(row_range._pb)
Comment thread
sahananshylaja-glitch marked this conversation as resolved.

def shard(self, shard_keys: RowKeySamples) -> ShardedQuery:
Expand Down
Loading