Skip to content

Commit

Permalink
Add span event on non-None span
Browse files Browse the repository at this point in the history
  • Loading branch information
odeke-em committed Nov 14, 2024
1 parent bf9922f commit 0379012
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion google/cloud/spanner_v1/transaction.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,9 @@ def commit(
if self._transaction_id is None and len(self._mutations) > 0:
self.begin()

span.add_event("Starting Commit")
if span:
span.add_event("Starting Commit")

database = self._session._database
api = database.spanner_api
metadata = _metadata_with_prefix(database.name)
Expand Down

0 comments on commit 0379012

Please sign in to comment.