Skip to content
Permalink
Browse files
fix(db_api): add dummy lastrowid attribute (#227)
  • Loading branch information
Ilya Gurov committed Feb 15, 2021
1 parent 4afea77 commit 0375914342de98e3903bae2097142325028d18d9
Showing with 5 additions and 1 deletion.
  1. +5 −1 google/cloud/spanner_dbapi/cursor.py
@@ -56,6 +56,7 @@ def __init__(self, connection):
self._itr = None
self._result_set = None
self._row_count = _UNSET_COUNT
self.lastrowid = None
self.connection = connection
self._is_closed = False
# the currently running SQL statement results checksum
@@ -89,7 +90,10 @@ def description(self):
:rtype: tuple
:returns: A tuple of columns' information.
"""
if not (self._result_set and self._result_set.metadata):
if not self._result_set:
return None

if not getattr(self._result_set, "metadata", None):
return None

row_type = self._result_set.metadata.row_type

0 comments on commit 0375914

Please sign in to comment.