Skip to content

fix(firestore): preserve async limit_to_last ordering - #17879

Merged
parthea merged 2 commits into
googleapis:mainfrom
Sanjays2402:fix/firestore-async-limit-to-last
Jul 29, 2026
Merged

fix(firestore): preserve async limit_to_last ordering#17879
parthea merged 2 commits into
googleapis:mainfrom
Sanjays2402:fix/firestore-async-limit-to-last

Conversation

@Sanjays2402

Copy link
Copy Markdown
Contributor

Closes #17767

The async limit-to-last path compared a protobuf direction enum with a string, so ascending queries were never reversed before fetching. Compare the enum name, matching the synchronous query path, and cover both directions.

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)

@Sanjays2402
Sanjays2402 requested a review from a team as a code owner July 23, 2026 10:14
@google-cla

google-cla Bot commented Jul 23, 2026

Copy link
Copy Markdown

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request fixes an issue in async_query.py where order.direction was compared directly instead of using its .name attribute. It also updates the corresponding unit test test_asyncquery_get_limit_to_last to be parameterized, verifying the behavior for both ascending and descending directions. There are no review comments, so I have no feedback to provide.

@parthea

parthea commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Hi @Sanjays2402, Please can you sign the CLA and mark this PR as ready for review once it's done?

See #17879 (comment)

@parthea
parthea marked this pull request as draft July 23, 2026 16:55
@parthea
parthea marked this pull request as ready for review July 29, 2026 15:08
@parthea parthea added kokoro:force-run Add this label to force Kokoro to re-run the tests. kokoro:run Add this label to force Kokoro to re-run the tests. labels Jul 29, 2026
@parthea parthea assigned parthea and unassigned Sanjays2402 Jul 29, 2026
@yoshi-kokoro yoshi-kokoro removed kokoro:run Add this label to force Kokoro to re-run the tests. kokoro:force-run Add this label to force Kokoro to re-run the tests. labels Jul 29, 2026
@parthea
parthea enabled auto-merge (squash) July 29, 2026 15:50
@parthea
parthea merged commit caf2fdb into googleapis:main Jul 29, 2026
39 of 40 checks passed
@parthea

parthea commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Thanks for the fix, @Sanjays2402!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

4 participants