Skip to content

Commit 2a4538c

Browse files
committed
missing commit
1 parent 3474442 commit 2a4538c

4 files changed

Lines changed: 357 additions & 360 deletions

File tree

sdk/cosmos/azure-cosmos/azure/cosmos/_cosmos_client_connection.py

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3418,23 +3418,23 @@ def __GetBodiesFromQueryResult(result: dict[str, Any]) -> list[dict[str, Any]]:
34183418
consecutive_no_progress_pages = 0
34193419

34203420
while pagination_state.can_issue_request():
3421-
current_feedrange = pagination_state.current_feedrange
3422-
if current_feedrange is None:
3421+
head_feedrange = pagination_state.head_feedrange
3422+
if head_feedrange is None:
34233423
break
34243424

34253425
# Look up the live routing map for the current feedrange.
34263426
# Doing this every iteration is what makes the token
34273427
# split-safe.
34283428
overlapping = self._routing_map_provider.get_overlapping_ranges(
3429-
resource_id, [current_feedrange], dict(options)
3429+
resource_id, [head_feedrange], dict(options)
34303430
)
34313431
overlapping, partition_scope = _build_scope_from_overlaps(
3432-
overlapping, current_feedrange
3432+
overlapping, head_feedrange
34333433
)
34343434

34353435
# Handle the case where Cosmos split a partition between the
34363436
# previous run and this one. Example: the saved
3437-
# current_feedrange used to live inside one partition X, but X
3437+
# head_feedrange used to live inside one partition X, but X
34383438
# has since been split into children X1 and X2. The routing
34393439
# map now returns two partitions for the same feedrange. If
34403440
# we sent one POST to X1 with X's full range as the EPK
@@ -3457,14 +3457,14 @@ def __GetBodiesFromQueryResult(result: dict[str, Any]) -> list[dict[str, Any]]:
34573457
# once more after resume when children X1/X2 restart from the
34583458
# start of their slices.
34593459
while pagination_state.explode_on_multi_overlap(overlapping):
3460-
current_feedrange = pagination_state.current_feedrange
3461-
if current_feedrange is None:
3460+
head_feedrange = pagination_state.head_feedrange
3461+
if head_feedrange is None:
34623462
break
34633463
overlapping = self._routing_map_provider.get_overlapping_ranges(
3464-
resource_id, [current_feedrange], dict(options)
3464+
resource_id, [head_feedrange], dict(options)
34653465
)
34663466
overlapping, partition_scope = _build_scope_from_overlaps(
3467-
overlapping, current_feedrange
3467+
overlapping, head_feedrange
34683468
)
34693469

34703470
backend_request_options = dict(options)
@@ -3479,12 +3479,12 @@ def __GetBodiesFromQueryResult(result: dict[str, Any]) -> list[dict[str, Any]]:
34793479
# The shared helper handles partition routing (PKR id +
34803480
# optional EPK filter), page-size cap, and continuation
34813481
# set/clear so the same rules apply to sync and async.
3482-
assert current_feedrange is not None # narrowed by the loop guards above
3482+
assert head_feedrange is not None # narrowed by the loop guards above
34833483
_apply_feedrange_request_headers(
34843484
req_headers,
34853485
overlapping,
34863486
partition_scope,
3487-
current_feedrange,
3487+
head_feedrange,
34883488
pagination_state.remaining_page_item_count,
34893489
backend_request_options.get("continuation"),
34903490
)
@@ -3537,7 +3537,7 @@ def __GetBodiesFromQueryResult(result: dict[str, Any]) -> list[dict[str, Any]]:
35373537
elif backend_query_result:
35383538
results = backend_query_result
35393539

3540-
previous_feedrange = pagination_state.current_feedrange
3540+
previous_feedrange = pagination_state.head_feedrange
35413541
previous_backend_continuation = pagination_state.backend_continuation
35423542
page_items_returned = _count_page_items_from_partial_result(backend_query_result, query)
35433543
if response_headers_list is not None:
@@ -3553,7 +3553,7 @@ def __GetBodiesFromQueryResult(result: dict[str, Any]) -> list[dict[str, Any]]:
35533553
page_items_returned,
35543554
previous_feedrange,
35553555
previous_backend_continuation,
3556-
pagination_state.current_feedrange,
3556+
pagination_state.head_feedrange,
35573557
pagination_state.backend_continuation,
35583558
)
35593559
if consecutive_no_progress_pages >= _MAX_CONSECUTIVE_NO_PROGRESS_PAGES:

0 commit comments

Comments
 (0)