File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed
packages/google-cloud-bigquery-storage/google/cloud/bigquery_storage_v1 Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -74,11 +74,16 @@ def read_rows(
7474 >>> # TODO: Initialize `parent`:
7575 >>> parent = 'projects/your-billing-project-id'
7676 >>>
77- >>> session = client.create_read_session(table, parent)
78- >>> stream=session.streams[0], # TODO: Read the other streams.
79- ...
77+ >>> requested_session = bigquery_storage_v1.types.ReadSession(
78+ ... table=table,
79+ ... data_format=bigquery_storage_v1.enums.DataFormat.AVRO,
80+ ... )
81+ >>> session = client.create_read_session(parent, requested_session)
82+ >>>
83+ >>> stream = session.streams[0], # TODO: Also read any other streams.
84+ >>> read_rows_stream = client.read_rows(stream.name)
8085 >>>
81- >>> for element in client.read_rows(stream ):
86+ >>> for element in read_rows_stream.rows(session ):
8287 ... # process element
8388 ... pass
8489
You can’t perform that action at this time.
0 commit comments