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: keep RowIterator.total_rows populated after iteration #1748

Merged
merged 2 commits into from
Dec 8, 2023

Conversation

tswast
Copy link
Contributor

@tswast tswast commented Dec 8, 2023

Split out of #1722

This was being reset in some cases when the rows were all available in the first page of results.

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 #589 🦕

This was being reset in some cases when
the rows were all available in the
first page of results.
@tswast tswast requested review from a team as code owners December 8, 2023 02:01
@product-auto-label product-auto-label bot added size: s Pull request size is small. api: bigquery Issues related to the googleapis/python-bigquery API. labels Dec 8, 2023
@tswast
Copy link
Contributor Author

tswast commented Dec 8, 2023

Alternatively, we could populate totalRows here if present:

Not sure which to prefer, but this way involved updating fewer tests.

google/cloud/bigquery/table.py Outdated Show resolved Hide resolved
Co-authored-by: Anthonios Partheniou <partheniou@google.com>
@tswast tswast enabled auto-merge (squash) December 8, 2023 21:36
@tswast tswast added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Dec 8, 2023
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Dec 8, 2023
@tswast tswast merged commit 8482f47 into main Dec 8, 2023
21 checks passed
@tswast tswast deleted the issue589-total_rows branch December 8, 2023 22:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: bigquery Issues related to the googleapis/python-bigquery API. size: s Pull request size is small.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Provide support for synchronous queries through the v2/projects/{projectId}/queries endpoint
3 participants