Skip to content

Commit

Permalink
docs: fix read_rows() docstring sample (#44)
Browse files Browse the repository at this point in the history
  • Loading branch information
plamut authored Jun 29, 2020
1 parent 645e65d commit 1ff6a08
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions google/cloud/bigquery_storage_v1/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,16 @@ def read_rows(
>>> # TODO: Initialize `parent`:
>>> parent = 'projects/your-billing-project-id'
>>>
>>> session = client.create_read_session(table, parent)
>>> stream=session.streams[0], # TODO: Read the other streams.
...
>>> requested_session = bigquery_storage_v1.types.ReadSession(
... table=table,
... data_format=bigquery_storage_v1.enums.DataFormat.AVRO,
... )
>>> session = client.create_read_session(parent, requested_session)
>>>
>>> stream = session.streams[0], # TODO: Also read any other streams.
>>> read_rows_stream = client.read_rows(stream.name)
>>>
>>> for element in client.read_rows(stream):
>>> for element in read_rows_stream.rows(session):
... # process element
... pass
Expand Down

0 comments on commit 1ff6a08

Please sign in to comment.