Skip to content

Make DB API Cursors iterable #607

@jimfulton

Description

@jimfulton

Thanks for stopping by to let us know something could be better!

PLEASE READ: If you have a support contract with Google, please create an issue in the support console instead of filing on GitHub. This will ensure a timely response.

Please run down the following list and make sure you've tried the usual "quick fixes":

If you are still having issues, please be sure to include as much information as possible:

Environment details

  • OS type and version: Ununtu 20.4
  • Python version: python --version 3.9.4
  • pip version: pip --version pip 21.0.1 from /home/jim/p/g/python-bigquery/env/3.9/lib/python3.9/site-packages/pip (python 3.9)
  • google-cloud-bigquery version: pip show google-cloud-bigquery 2.13.1

Steps to reproduce

  1. ?

Code example

>>> import google.cloud.bigquery.dbapi
>>> conn = google.cloud.bigquery.dbapi.connect()
/home/jim/p/g/python-bigquery/google/cloud/bigquery/client.py:444: UserWarning: Cannot create BigQuery Storage client, the dependency google-cloud-bigquery-storage is not installed.
  warnings.warn(
>>> cursor = conn.cursor()
>>> cursor.execute("select 1")
>>> list(cursor)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: 'Cursor' object is not iterable
>>> 

Iterability is optional, but widely implemented in dbapi implementations, because it's so useful.

Metadata

Metadata

Assignees

Labels

api: bigqueryIssues related to the googleapis/python-bigquery API.dbapitype: 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