BigQuery: Change the default value of Cursor instances' arraysize attribute to None#9199
Merged
plamut merged 2 commits intogoogleapis:masterfrom Sep 12, 2019
Merged
BigQuery: Change the default value of Cursor instances' arraysize attribute to None#9199plamut merged 2 commits intogoogleapis:masterfrom
plamut merged 2 commits intogoogleapis:masterfrom
Conversation
Contributor
|
completely forgot about the Rather than add this note, I think it may make more sense to diverge from the DB-API spec (which dictates a default google-cloud-python/bigquery/google/cloud/bigquery/dbapi/cursor.py Lines 63 to 65 in cf44700 If we instead default to |
Contributor
Author
I see, that actually makes sense. It's safer than just having it in the docs, as some portion of the users will probably still overlook it. |
Let the backend pick the most appropriate size automatically, instead of enforcing the size of 1 on it (despite thise being a deviation from PEP 249).
tswast
approved these changes
Sep 12, 2019
emar-kar
pushed a commit
to MaxxleLLC/google-cloud-python
that referenced
this pull request
Sep 18, 2019
…ribute to None (googleapis#9199) * Add performance note to fetchall() docs * Set default cursor arraysize to None Let the backend pick the most appropriate size automatically, instead of enforcing the size of 1 on it (despite thise being a deviation from PEP 249).
emar-kar
pushed a commit
to MaxxleLLC/google-cloud-python
that referenced
this pull request
Sep 18, 2019
…ribute to None (googleapis#9199) * Add performance note to fetchall() docs * Set default cursor arraysize to None Let the backend pick the most appropriate size automatically, instead of enforcing the size of 1 on it (despite thise being a deviation from PEP 249).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Closes #9185.
This PR adds a note on
arraysizeparameter, and its impact on thefetchall()method performance.To discuss
Following a comment on the issue, should we reanimate thefetchmany()'ssizeparameter, too?No (for the time being), as that would require implementing a custom pagination logic in the client (comment).
How to test
Run the code sample from the issue description, and verify that by settingcursor.arraysizeto appropriate value avoids the reported performance issue, which what the updated docs point out.Run the code sample from the issue description, and verify that the new default value of
cursor.arraysizeavoids the reported performance issue. Or setting that value manually to something appropriate.