From b27472fc1fb42368ffe1556c848dc3b21b2fca0c Mon Sep 17 00:00:00 2001 From: Yusuke Nishioka Date: Sat, 22 Apr 2023 02:13:38 +0900 Subject: [PATCH] feat: Cache Bigtable client (#3602) * Cache Bigtable client Signed-off-by: Yusuke Nishioka * Run format Signed-off-by: Yusuke Nishioka --------- Signed-off-by: Yusuke Nishioka --- sdk/python/feast/infra/online_stores/bigtable.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sdk/python/feast/infra/online_stores/bigtable.py b/sdk/python/feast/infra/online_stores/bigtable.py index e08bc44bdb..30561d0840 100644 --- a/sdk/python/feast/infra/online_stores/bigtable.py +++ b/sdk/python/feast/infra/online_stores/bigtable.py @@ -335,4 +335,8 @@ def teardown( def _get_client( self, online_config: BigtableOnlineStoreConfig, admin: bool = False ): - return bigtable.Client(project=online_config.project_id, admin=admin) + if self._client is None: + self._client = bigtable.Client( + project=online_config.project_id, admin=admin + ) + return self._client