Description
Is your feature request related to a problem? Please describe.
I'd like to be able to run a query against a Spanner database and download (possibly large-ish -- MBs to GBs) results to a pandas DataFrame. Specifically, I'd like to eventually use this as a component in an ibis connector, but it'd also be useful for general data processing pipelines.
Describe the solution you'd like
It seems that StreamedResultSet is the most natural place to put a to_dataframe
method, similar to the RowIterator.to_dataframe method in the BigQuery client library.
Since pandas
needn't be required to use this client library, the import should be conditional
and the dependency listed in "extras".
Describe alternatives you've considered
It's possible this is simpler than realized, so maybe could just be a code sample.
If there were a SQLAlchemy connector (a much bigger project than read-only pandas dataframe), then pandas support is basically free via pandas.read_sql
.
Additional context
Related StackOverflow questions: