Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: ordering in limit_to_last #692

Merged
merged 1 commit into from
Feb 21, 2023
Merged

fix: ordering in limit_to_last #692

merged 1 commit into from
Feb 21, 2023

Conversation

Mariatta
Copy link
Contributor

@Mariatta Mariatta commented Feb 18, 2023

When limit_to_last was set, we need to reverse the order. However due to error in comparing the order direction, it was not properly set.

comparing order.direction == self.ASCENDING is always False because there are two different types.

The correct way is by comparing order.direction.name == self.ASCENDING

Fixes #536

Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly:

  • Make sure to open an issue as a bug/issue before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea
  • Ensure the tests and linter pass
  • Code coverage does not decrease (if any source code was changed)
  • Appropriate docs were updated (if necessary)

Fixes #<issue_number_goes_here> 🦕

When limit_to_last was set, we need to reverse the order. However due to error in comparing the order direction, it was not properly set.

comparing `order.direction == self.ASCENDING` is always `False` because there are two different types.

The correct way is by comparing `order.direction.name == self.ASCENDING`

Fixes #536
@Mariatta Mariatta requested review from a team as code owners February 18, 2023 01:12
@product-auto-label product-auto-label bot added size: xs Pull request size is extra small. api: firestore Issues related to the googleapis/python-firestore API. labels Feb 18, 2023
@engelke engelke merged commit cc9dfb3 into main Feb 21, 2023
@engelke engelke deleted the fix-limit-to-last-order branch February 21, 2023 21:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: firestore Issues related to the googleapis/python-firestore API. size: xs Pull request size is extra small.
Projects
None yet
3 participants