Skip to content
This repository was archived by the owner on Mar 6, 2026. It is now read-only.
This repository was archived by the owner on Mar 6, 2026. It is now read-only.

page_size is ignored when using to_dataframe_iterable with bqstorage_client #1256

Closed

Description

@Lmmejia11

Environment details

  • OS type and version: Debian 10 (dataproc image 2.0-debian10)
  • Python version: python --version : Python 3.8.10
  • pip version: pip --version: pip 22.1
  • google-cloud-bigquery version: pip show google-cloud-bigquery : google-cloud-bigquery==2.34.3, google-cloud-bigquery-storage==2.13.1

Steps to reproduce

Define a job with page_size and use to_dataframe_iterable with a bqstorage_client. The page_size argument is ignored: the number of rows in the dataframes dont correspond to page_size

Code example

from google.cloud import bigquery_storage
from google.cloud import bigquery

project_name = 'my_project'
table_name = 'tmp.my_table'
bq_client = bigquery.Client(project=project_name)
bqstorageclient = bigquery_storage.BigQueryReadClient()

# to_dataframe_iterable with list_rows and bqstorage_client. It ignores page_size and uses default
job0 = bq_client.list_rows(
   table=table_name,
   page_size=100
)
i0 = job0.to_dataframe_iterable(bqstorage_client=bqstorageclient)
print(next(i0).shape) # (896, 32)

# to_dataframe_iterable with list_rows. page_size is respected
job1 = bq_client.list_rows(
   table=table_name,
   page_size=100
)
i1 = job1.to_dataframe_iterable()
print(next(i1).shape) # (100, 32)

# to_dataframe_iterable with query and bqstorage_client. It ignores page_size and uses default
job2 = bq_client.query(
   query='SELECT * FROM %s' % table_name,
)
i2 = job2.result(page_size=100).to_dataframe_iterable(bqstorage_client=bqstorageclient)
print(next(i2).shape) # (896, 32)

# to_dataframe_iterable with query. page_size is respected
job3 = bq_client.query(
   query='SELECT * FROM %s' % table_name,
)
i3 = job3.result(page_size=100).to_dataframe_iterable()
print(next(i3).shape) # (100, 32)

Activity

  1. added
    api: bigquery
    on May 19, 2022
  2. added
    triage me
    on May 20, 2022
  3. added
    type: bug
    priority: p2
    and removed
    triage me
    on May 24, 2022
  4. self-assigned this
    on Jun 6, 2022
  5. steffnay commented on Jun 8, 2022

    @steffnay
    Contributor

    Hi, @Lmmejia11 I think page_size cannot be set with bqstorage_client because BigQuery Storage doesn't read rows in terms of pages and does not accept a page_size option.

  6. steffnay commented on Jun 9, 2022

    @steffnay
    Contributor

    Closing, please reopen if more investigation is required.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

api: bigquerypriority: p2type: bug

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions