From 25edeaae84b7aa0fdf7fcedf88733ba3a7e6ec77 Mon Sep 17 00:00:00 2001 From: Emmanuel T Odeke Date: Wed, 13 Nov 2024 21:02:20 -0800 Subject: [PATCH] Use getattr for mock _Client --- google/cloud/spanner_v1/database.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/google/cloud/spanner_v1/database.py b/google/cloud/spanner_v1/database.py index 3329bd6e69..4b6ff4bb4c 100644 --- a/google/cloud/spanner_v1/database.py +++ b/google/cloud/spanner_v1/database.py @@ -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):