Skip to content

BigQuery: Client.list_rows should prefetch the first page and populate total_rows and other attributes #4152

@bits01

Description

@bits01

https://googlecloudplatform.github.io/google-cloud-python/latest/_modules/google/cloud/bigquery/table.html#Table.fetch_data

Return value doc:

:returns: Iterator of row data :class:`tuple`s. During each page, the
                  iterator will have the ``total_rows`` attribute set,
                  which counts the total number of rows **in the table**
                  (this is distinct from the total number of rows in the
                  current page: ``iterator.page.num_items``).

The iterator does not have the total_rows attribute or a page attribute either.

Can fetch_data() get a count of all rows or the only way is to iterate and count?

Metadata

Metadata

Assignees

Labels

api: bigqueryIssues related to the BigQuery API.priority: p2Moderately-important priority. Fix may not be included in next release.type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions