GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — feat: support setting max_stream_count when fetching query result by kien-truong · Pull Request #2051 · googleapis/python-bigquery

This repository was archived by the owner on Mar 6, 2026. It is now read-only.

Conversation

@kien-truong

@kien-truong kien-truong commented Nov 3, 2024

Copy link
Copy Markdown
Contributor

Allow user to set max_stream_count when fetching result using BigQuery Storage API with incremental methods:

  • to_arrow_iterable
  • to_dataframe_iterable

Fixes #2030 🦕

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@kien-truong
kien-truong requested review from a team and alvarowolfx November 3, 2024 03:29
@blunderbuss-gcf blunderbuss-gcf Bot assigned alvarowolfx Nov 3, 2024
@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 Nov 3, 2024
@alvarowolfx
alvarowolfx requested review from chalmerlowe and removed request for alvarowolfx November 4, 2024 14:08
@Linchin Linchin added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Nov 11, 2024
@Linchin Linchin assigned Linchin and unassigned alvarowolfx Nov 11, 2024
Linchin
Linchin reviewed Nov 11, 2024
View reviewed changes
Comment thread google/cloud/bigquery/table.py
created by the server. If ``max_queue_size`` is :data:`None`, the queue
size is infinite.

max_stream_count (Optional[int]):

@Linchin Linchin Nov 11, 2024

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

I think it would be more consistent if we use the same docstring as here. It also mentions the effect of preserve_order (in this case self._preserve_order), which I think we should make clear here.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@kien-truong kien-truong Nov 11, 2024

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

In this case, _preserve_order is automatically set by parsing the queries, and not a user-facing API. I'll update the docstring to mention that effect.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Linchin reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

@kien-truong kien-truong Nov 16, 2024

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Updated

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Linchin
Linchin reviewed Nov 11, 2024
View reviewed changes
Comment thread google/cloud/bigquery/table.py

.. versionadded:: 2.14.0

max_stream_count (Optional[int]):

@Linchin Linchin Nov 11, 2024

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

same as https://github.com/googleapis/python-bigquery/pull/2051/files#r1836568949

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@Linchin

Linchin commented Nov 11, 2024

Copy link
Copy Markdown
Contributor

Thank you @kien-truong for adding further support for max_stream_count! I left some comments, and I wonder if you could add some unit tests too (we typically require 100% unit test coverage). You could find similar tests in PR #2039. If you need any help with it, feel free to let me know. I'd be more than glad to help!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@Linchin Linchin added the kokoro:run Add this label to force Kokoro to re-run the tests. label Nov 11, 2024
@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 Nov 11, 2024
@kien-truong

kien-truong commented Nov 11, 2024

Copy link
Copy Markdown
Contributor Author

Hi, the default code path with the default arguments is already covered by the current tests.
I'll see if I can add tests for when the user manually set the argument when I have time at weekend.

Linchin reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@Linchin

Linchin commented Nov 11, 2024

Copy link
Copy Markdown
Contributor

@kien-truong sounds good. The mypy test is also failing, could you fix it too? You can run it by running nox -s mypy in the repo. (You can install nox by pip install nox)

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@product-auto-label product-auto-label Bot added size: m Pull request size is medium. and removed size: s Pull request size is small. labels Nov 16, 2024
@kien-truong
kien-truong force-pushed the max-stream-count-api branch 3 times, most recently from 31662ad to 0e52722 Compare November 16, 2024 03:51
kien-truong added 4 commits November 16, 2024 10:52
@kien-truong
feat: support setting max_stream_count when fetching query result
40a0ef7
Allow user to set max_stream_count when fetching result
using BigQuery Storage API with RowIterator's incremental methods:

* to_arrow_iterable
* to_dataframe_iterable
@kien-truong
docs: update docs about max_stream_count for ordered query
5e8811c
@kien-truong
fix: add max_stream_count params to _EmptyRowIterator's methods
9e20bac
@kien-truong
test: add tests for RowIterator's max_stream_count parameter
fb726eb
@kien-truong
kien-truong force-pushed the max-stream-count-api branch from 0e52722 to fb726eb Compare November 16, 2024 03:52
@kien-truong

kien-truong commented Nov 16, 2024

Copy link
Copy Markdown
Contributor Author

I have added tests to cover user-provided max_stream_count flow and fixed the mypy test as well.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@kien-truong
docs: add notes on valid max_stream_count range in docstring
2c936b2
@kien-truong kien-truong mentioned this pull request Nov 16, 2024
Make max_stream_count configurable when using Bigquery Storage API #2030
Closed
@chalmerlowe chalmerlowe added the kokoro:run Add this label to force Kokoro to re-run the tests. label Nov 18, 2024
@yoshi-kokoro yoshi-kokoro removed the kokoro:run Add this label to force Kokoro to re-run the tests. label Nov 18, 2024
@Linchin
Merge branch 'main' into max-stream-count-api
39a837c
@Linchin Linchin added the kokoro:run Add this label to force Kokoro to re-run the tests. label Nov 18, 2024
@yoshi-kokoro yoshi-kokoro removed the kokoro:run Add this label to force Kokoro to re-run the tests. label Nov 18, 2024
Linchin
Linchin reviewed Nov 19, 2024
View reviewed changes
Comment thread tests/unit/test_table.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

Linchin
Linchin reviewed Nov 19, 2024
View reviewed changes
Comment thread tests/unit/test_table.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

@Linchin

Linchin commented Nov 19, 2024

Copy link
Copy Markdown
Contributor

Thanks @kien-truong, the PR mostly looks good. I just have some small question regarding ignored coverage for the tests.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@Linchin
use a different way to iterate result
c00c7b3
@Linchin Linchin added the kokoro:run Add this label to force Kokoro to re-run the tests. label Nov 22, 2024
@yoshi-kokoro yoshi-kokoro removed the kokoro:run Add this label to force Kokoro to re-run the tests. label Nov 22, 2024
@Linchin
Linchin self-requested a review November 22, 2024 21:34
Linchin
Linchin approved these changes Nov 22, 2024
View reviewed changes

@Linchin Linchin left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

LGTM. Thank you!

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@Linchin
Linchin merged commit d461297 into googleapis:main Nov 22, 2024
@release-please release-please Bot mentioned this pull request Nov 18, 2024
chore(main): release 3.28.0 #2056
Merged
@chalmerlowe chalmerlowe mentioned this pull request Nov 25, 2024
Massive downloads (1B+ rows) causes read errors #1252
Closed
This was referenced Jan 21, 2025
January 20, 2025 kitta65/bq-extension-vscode#639
Closed
January 20, 2025 kitta65/prettier-plugin-bq#579
Closed
January 20, 2025 kitta65/bq2cst#468
Closed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Reviewers

@chalmerlowe chalmerlowe Awaiting requested review from chalmerlowe
1 more reviewer
@Linchin Linchin Linchin approved these changes
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@Linchin Linchin

Labels

api: bigquery Issues related to the googleapis/python-bigquery API. size: m Pull request size is medium.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Make max_stream_count configurable when using Bigquery Storage API

Uh oh!

There was an error while loading. Please reload this page.

5 participants

@kien-truong @Linchin @alvarowolfx @chalmerlowe @yoshi-kokoro
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.