Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BigQuery: Make RowIterator._to_dataframe_iterable public #7339

Closed
tswast opened this issue Feb 13, 2019 · 3 comments · Fixed by #10017
Closed

BigQuery: Make RowIterator._to_dataframe_iterable public #7339

tswast opened this issue Feb 13, 2019 · 3 comments · Fixed by #10017
Assignees
Labels
api: bigquery Issues related to the BigQuery API. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.

Comments

@tswast
Copy link
Contributor

tswast commented Feb 13, 2019

Follow-up to #7293

There are use cases where it's not ideal to download a whole table at once, but a pandas DataFrame is still desired.

Potential solution:

Make the pages member of RowIterator return a generator of a subclass of google.api_core.page_iterator.Page with a to_dataframe() method.

@tswast tswast added type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design. api: bigquery Issues related to the BigQuery API. labels Feb 13, 2019
@tswast tswast self-assigned this Apr 9, 2019
@agsha
Copy link

agsha commented Nov 27, 2019

Any updates on this?

@tswast
Copy link
Contributor Author

tswast commented Dec 19, 2019

We have a private method RowIterator._to_dataframe_iterable that we could make public.

def _to_dataframe_iterable(self, bqstorage_client=None, dtypes=None):

When I originally filed this FR, I thought a per-page to_dataframe would be more appropriate, but it's actually quite difficult to override the page class with how the superclasses are structured. Plus, it wouldn't be able to take advantage of the BQ Storage API if we used the pages property.

@tswast tswast assigned HemangChothani and unassigned tswast Dec 19, 2019
@tswast tswast changed the title BigQuery: RowIterator.pages should allow converting each page to a pandas DataFrame, one at a time BigQuery: Make RowIterator._to_dataframe_iterable public Dec 19, 2019
@tswast
Copy link
Contributor Author

tswast commented Dec 19, 2019

@HemangChothani I think this is a good task you all. #7339 (comment)

In addition to making it public, let's make sure we have some unit tests for using the function directly.

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. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants