Skip to content

Commit

Permalink
Use getattr for mock _Client
Browse files Browse the repository at this point in the history
  • Loading branch information
odeke-em committed Nov 14, 2024
1 parent 797241f commit 25edeaa
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions google/cloud/spanner_v1/database.py
Original file line number Diff line number Diff line change
Expand Up @@ -1113,10 +1113,10 @@ def observability_options(self):
Returns the observability options that you set when creating
the SpannerClient.
"""
if not self._instance:
if not (self._instance and self._instance._client):
return None

return self._instance._client.observability_options
return getattr(self._instance._client, 'observability_options', None)


class BatchCheckout(object):
Expand Down

0 comments on commit 25edeaa

Please sign in to comment.