One of Cloud Spanner customers had a bug where they were iterating on StreamedResultSet.rows and were not getting any data back:
result = transaction.execute_sql(query)
# here result.rows is empty
for row in result.rows:
print(row) # prints nothing
This is kind of working as intended because result.rows will only contain data when consume_next or consume_all is called. But it is still a very confusing API and easy to get wrong. It is also not clear to me at any point in time what rows will be present in this list.
I think we should make the rows private and not expose it to the user. We should do it before marking the library as GA as this is a breaking change.
cc @lukesneeringer @tseaver @danoscarmike
One of Cloud Spanner customers had a bug where they were iterating on StreamedResultSet.rows and were not getting any data back:
This is kind of working as intended because result.rows will only contain data when
consume_nextorconsume_allis called. But it is still a very confusing API and easy to get wrong. It is also not clear to me at any point in time what rows will be present in this list.I think we should make the rows private and not expose it to the user. We should do it before marking the library as GA as this is a breaking change.
cc @lukesneeringer @tseaver @danoscarmike