Skip to content

Conversation

@plamut
Copy link
Contributor

@plamut plamut commented Jul 17, 2019

Closes #5204.

This PR adds the last missing piece of the feature, i.e. the bqstorage_client parameter 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 the to_dataframe() methods).

plamut added 3 commits July 17, 2019 16:00
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.
@plamut plamut added the api: bigquery Issues related to the BigQuery API. label Jul 17, 2019
@plamut plamut requested review from a team and tswast July 17, 2019 14:58
@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Jul 17, 2019
inspect.signature() method is only available in older Python versions

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()
Copy link
Contributor Author

Choose a reason for hiding this comment

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

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.

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
Copy link
Contributor

Choose a reason for hiding this comment

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

Love this! ❤️ Thanks for the test. I wouldn't have thought to try this.

@tswast tswast assigned plamut and tswast and unassigned tswast and plamut Jul 17, 2019
@tswast tswast merged commit 562deea into googleapis:master Jul 17, 2019
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 BigQuery API. cla: yes This human has signed the Contributor License Agreement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

BigQuery: to_arrow() method similar to to_dataframe()

3 participants