BigQuery: Complete the to_arrow() method feature request#8693
Merged
tswast merged 4 commits intogoogleapis:masterfrom Jul 17, 2019
Merged
BigQuery: Complete the to_arrow() method feature request#8693tswast merged 4 commits intogoogleapis:masterfrom
tswast merged 4 commits intogoogleapis:masterfrom
Conversation
The method signatures for to_arrow() and to_dataframe() methods in the job.QueryJob and table.RowIterator classes must match to present a consistent API for users.
inspect.signature() method is only available in older Python versions
plamut
commented
Jul 17, 2019
|
|
||
| def to_arrow(self, progress_bar_type=None): | ||
| # If changing the signature of this method, make sure to apply the same | ||
| # changes to table.RowIterator.to_arrow() |
Contributor
Author
There was a problem hiding this comment.
Note - this and the other similar comments might be redundant now that we have a test for method signatures, but I personally don't mind having them, as it makes the contract between the two classes more explicit.
tswast
approved these changes
Jul 17, 2019
| def test_to_arrow_method_signatures_match(query_job_class, row_iterator_class): | ||
| sig = inspect.signature(query_job_class.to_arrow) | ||
| sig2 = inspect.signature(row_iterator_class.to_arrow) | ||
| assert sig == sig2 |
Contributor
There was a problem hiding this comment.
Love this! ❤️ Thanks for the test. I wouldn't have thought to try this.
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 #5204.
This PR adds the last missing piece of the feature, i.e. the
bqstorage_clientparameter that was still missing from one of the methods.How to test
Check that the signatures for various
to_arrow()methods match (and the same for theto_dataframe()methods).