Skip to content

Commit

Permalink
fix(db_api): add dummy lastrowid attribute (#227)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ilya Gurov committed Feb 15, 2021
1 parent 4afea77 commit 0375914
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion google/cloud/spanner_dbapi/cursor.py
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 0375914

Please sign in to comment.