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: updates to allow users to set max_stream_count by chalmerlowe · Pull Request #2039 · googleapis/python-bigquery

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

Conversation

@chalmerlowe

@chalmerlowe chalmerlowe commented Oct 4, 2024 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Collaborator

Adds a function determine_requested_streams() to compare preserve_order and the new argument max_stream_count to determine how many streams to request.

preserve_order (bool): Whether to preserve the order of streams. If True,
    this limits the number of streams to one (more than one cannot guarantee order).
max_stream_count (Union[int, None]]): The maximum number of streams
    allowed. Must be a non-negative number or None, where None indicates
    the value is unset. If `max_stream_count` is set, it overrides
    `preserve_order`.

Fixes #2030 🦕

Sorry, something went wrong.

Uh oh!

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

wasabigeek reacted with heart emoji
All reactions
  • ❤️ 1 reaction
chalmerlowe added 2 commits October 3, 2024 18:55
@chalmerlowe
adds a new requested_stream function and docstring
6593ee9
@chalmerlowe
Adds new function to compare preserve_order and max_stream_count
58f3f27
@chalmerlowe
chalmerlowe requested review from a team and tswast October 4, 2024 12:32
@product-auto-label product-auto-label Bot added size: m Pull request size is medium. api: bigquery Issues related to the googleapis/python-bigquery API. labels Oct 4, 2024
@blunderbuss-gcf blunderbuss-gcf Bot assigned suzmue Oct 4, 2024
chalmerlowe and others added 6 commits October 4, 2024 14:50
@chalmerlowe
Updates type hints to resolve mypy errors
f4e0d6e
@chalmerlowe
corrects some mypy, linting errors
91190d7
@chalmerlowe
updates several type hints
8f1f090
@chalmerlowe
updates pandas type hint because of unit-noextras
0e9c1b0
@chalmerlowe
adds validation and unit tests
6144379
@gcf-owl-bot
🦉 Updates from OwlBot post-processor
1d635ac
See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md
@chalmerlowe
chalmerlowe requested review from suzmue and removed request for tswast October 7, 2024 15:54
@chalmerlowe chalmerlowe self-assigned this Oct 7, 2024
@kien-truong

kien-truong commented Oct 7, 2024

Copy link
Copy Markdown
Contributor

Shouldn't preserve_order take priority over max_stream_count for correctness ?

All reactions

Sorry, something went wrong.

Uh oh!

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

@chalmerlowe

chalmerlowe commented Oct 7, 2024

Copy link
Copy Markdown
Collaborator Author

@kien-truong

In the question of which argument overrides which, I could probably be convinced to go either way.

I purposely chose for max_streams_count to override preserve_order and wrote the docstring to state that, because:

  • max_streams_count defaults to None and any user whose in-house code currently makes the call to _download_table_bqstorage() but does NOT include max_streams_count but does have a value for preserve_order will see the same behavior.
  • If however, they go to the trouble of including a value for max_streams_count I would presume that they are doing so with an understanding of the new parameter and how it will affect any previous settings for preserve_order as defined in the docstring.
All reactions

Sorry, something went wrong.

Uh oh!

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

@suzmue

suzmue commented Oct 7, 2024 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Contributor

@chalmerlowe @kien-truong

I am also in favor of having preserve_order override the max_streams_count setting. I think this would make it easier to use and understand.

If max_streams_count >= 1 this condition would still be satisfied by setting requested_streams = 1 since max_streams_count isn't a guarantee of any number of streams even in the bq storage api and from the issue, it seems that an import use case is to limit the number of streams, not increase them (though I am sure there are use cases for that as well).

Perhaps an error for when max_streams_count == 0 and preserve_order would make sense to have if we swap to favoring preserve_order, since then they are explicitly requesting both unlimited streams and a single stream.

Edit: Actually I don't think the error is necessary for the same reason as why setting to 1 should always be ok.

All reactions

Sorry, something went wrong.

Uh oh!

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

@chalmerlowe

chalmerlowe commented Oct 7, 2024

Copy link
Copy Markdown
Collaborator Author

let me cogitate on this. thanks for the input, both of you.

All reactions

Sorry, something went wrong.

Uh oh!

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

chalmerlowe and others added 3 commits October 8, 2024 13:42
@chalmerlowe
updates precedence rules and tests
0a0c71c
@gcf-owl-bot
🦉 Updates from OwlBot post-processor
67e7f2b
See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md
@chalmerlowe
updates docstring in _download_table_bqstorage
2a8bb7f
@chalmerlowe

chalmerlowe commented Oct 8, 2024

Copy link
Copy Markdown
Collaborator Author

@suzmue @kien-truong

I revised the logic. Once the CI/CD checks pass, can you approve it, Suzy?

All reactions

Sorry, something went wrong.

Uh oh!

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

@gcf-owl-bot
🦉 Updates from OwlBot post-processor
820e4ee
See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md
suzmue
suzmue approved these changes Oct 9, 2024
View reviewed changes
Comment thread google/cloud/bigquery/_pandas_helpers.py Resolved

Uh oh!

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

Comment thread google/cloud/bigquery/_pandas_helpers.py Resolved

Uh oh!

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

Comment thread google/cloud/bigquery/_pandas_helpers.py Resolved

Uh oh!

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

Comment thread google/cloud/bigquery/_pandas_helpers.py Resolved

Uh oh!

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

chalmerlowe and others added 3 commits October 10, 2024 05:12
@chalmerlowe @suzmue
Update google/cloud/bigquery/_pandas_helpers.py
656b4f7
Co-authored-by: Suzy Mueller <[email protected]>
@chalmerlowe @suzmue
Update google/cloud/bigquery/_pandas_helpers.py
fe64501
Co-authored-by: Suzy Mueller <[email protected]>
@chalmerlowe @suzmue
Update google/cloud/bigquery/_pandas_helpers.py
9de98fe
Co-authored-by: Suzy Mueller <[email protected]>
chalmerlowe and others added 10 commits October 10, 2024 05:13
@chalmerlowe
Merge branch 'main' into update-maxstreams
bd2fea0
@gcf-owl-bot
🦉 Updates from OwlBot post-processor
8d67a75
See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md
@gcf-owl-bot
Merge branch 'update-maxstreams' of https://github.com/googleapis/pyt…
2251dd9
…hon-bigquery into update-maxstreams
@gcf-owl-bot
🦉 Updates from OwlBot post-processor
e537613
See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md
@gcf-owl-bot
Merge branch 'update-maxstreams' of https://github.com/googleapis/pyt…
6be29d6
…hon-bigquery into update-maxstreams
@gcf-owl-bot
🦉 Updates from OwlBot post-processor
a3160ee
See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md
@gcf-owl-bot
Merge branch 'update-maxstreams' of https://github.com/googleapis/pyt…
94a7c28
…hon-bigquery into update-maxstreams
@gcf-owl-bot
🦉 Updates from OwlBot post-processor
6f12c0c
See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md
@gcf-owl-bot
Merge branch 'update-maxstreams' of https://github.com/googleapis/pyt…
71f2799
…hon-bigquery into update-maxstreams
@chalmerlowe
Update _pandas_helpers.py
4da6bf6
Removed unnecessary else statement.
@chalmerlowe chalmerlowe added the automerge Merge the pull request once unit tests and other checks pass. label Oct 10, 2024
@gcf-merge-on-green
gcf-merge-on-green Bot merged commit 7372ad6 into main Oct 10, 2024
@gcf-merge-on-green gcf-merge-on-green Bot removed the automerge Merge the pull request once unit tests and other checks pass. label Oct 10, 2024
@gcf-merge-on-green
gcf-merge-on-green Bot deleted the update-maxstreams branch October 10, 2024 09:32
@release-please release-please Bot mentioned this pull request Oct 10, 2024
chore(main): release 3.27.0 #2040
Merged
chalmerlowe added a commit that referenced this pull request Nov 1, 2024
@chalmerlowe
feat: updates to allow users to set max_stream_count (#2039)
6d5e765
Adds a function `determine_requested_streams()` to compare `preserve_order` and the new argument `max_stream_count` to determine how many streams to request.

```
preserve_order (bool): Whether to preserve the order of streams. If True,
    this limits the number of streams to one (more than one cannot guarantee order).
max_stream_count (Union[int, None]]): The maximum number of streams
    allowed. Must be a non-negative number or None, where None indicates
    the value is unset. If `max_stream_count` is set, it overrides
    `preserve_order`.
```

Fixes #2030 🦕
@Linchin Linchin mentioned this pull request Nov 11, 2024
feat: support setting max_stream_count when fetching query result #2051
Merged
This was referenced Nov 12, 2024
November 11, 2024 kitta65/bq-extension-vscode#575
Closed
November 11, 2024 kitta65/prettier-plugin-bq#533
Closed
November 11, 2024 kitta65/bq2cst#445
Closed
@chalmerlowe chalmerlowe mentioned this pull request Nov 25, 2024
Massive downloads (1B+ rows) causes read errors #1252
Closed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Reviewers

1 more reviewer
@suzmue suzmue suzmue approved these changes
Reviewers whose approvals may not affect merge requirements

Uh oh!

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

Assignees

@suzmue suzmue

@chalmerlowe chalmerlowe

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.

3 participants

@chalmerlowe @kien-truong @suzmue
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.