Skip to content

Commit

Permalink
renamed variable
Browse files Browse the repository at this point in the history
  • Loading branch information
daniel-sanche committed Nov 2, 2023
1 parent bfb209f commit 9ea445e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions google/cloud/firestore_v1/base_query.py
Original file line number Diff line number Diff line change
Expand Up @@ -868,7 +868,7 @@ def _normalize_orders(self) -> list:
_has_snapshot_cursor = True
if _has_snapshot_cursor:
# added orders should use direction of last order
direction = orders[-1].direction if orders else BaseQuery.ASCENDING
last_direction = orders[-1].direction if orders else BaseQuery.ASCENDING
order_keys = [order.field.field_path for order in orders]
for filter_ in self._field_filters:
# FieldFilter.Operator should not compare equal to
Expand All @@ -880,10 +880,10 @@ def _normalize_orders(self) -> list:
filter_.op not in _EQUALITY_OPERATORS
and field not in order_keys
):
orders.append(self._make_order(field, direction))
orders.append(self._make_order(field, last_direction))
# add __name__ if not already in orders
if "__name__" not in [order.field.field_path for order in orders]:
orders.append(self._make_order("__name__", direction))
orders.append(self._make_order("__name__", last_direction))

return orders

Expand Down

0 comments on commit 9ea445e

Please sign in to comment.