Skip to content

Commit

Permalink
Fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
odeke-em committed Dec 3, 2024
1 parent 2d074ba commit 060d17c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions google/cloud/spanner_v1/pool.py
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,7 @@ def get(self):
span_event_attributes,
)
session = self._sessions.get_nowait()
except queue.Empty as e:
except queue.Empty:
add_span_event(
current_span,
"No sessions available in pool. Creating session",
Expand Down Expand Up @@ -510,8 +510,9 @@ def bind(self, database):
session_count=self.size - created_session_count,
session_template=Session(creator_role=self.database_role),
)
span_event_attributes = {"kind": type(self).__name__}

span_event_attributes = {"kind": type(self).__name__}
current_span = get_current_span()
requested_session_count = request.session_count
if requested_session_count <= 0:
add_span_event(
Expand All @@ -521,7 +522,6 @@ def bind(self, database):
)
return

current_span = get_current_span()
add_span_event(
current_span,
f"Requesting {requested_session_count} sessions",
Expand Down
4 changes: 2 additions & 2 deletions tests/unit/test_pool.py
Original file line number Diff line number Diff line change
Expand Up @@ -248,12 +248,12 @@ def test_spans_bind_get_empty_pool(self):
pool = self._make_one(size=0)
database = _Database("name")
session1 = _Session(database)
with trace_call("pool.Get", session1) as span:
with trace_call("pool.Get", session1):
try:
pool.bind(database)
database._sessions = database._sessions[:0]
pool.get()
except:
except Exception:
pass

wantEventNames = [
Expand Down

0 comments on commit 060d17c

Please sign in to comment.