From 308db98caf37e626780fd228da4a30fc6b5b830f Mon Sep 17 00:00:00 2001 From: Vivian Nguyen Date: Fri, 23 Feb 2024 11:20:26 -0600 Subject: [PATCH] Use _internal_tiledb_config in native_context --- .../src/tiledbsoma/options/_soma_tiledb_context.py | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/apis/python/src/tiledbsoma/options/_soma_tiledb_context.py b/apis/python/src/tiledbsoma/options/_soma_tiledb_context.py index d4ae2358ee..9ed0c2aca6 100644 --- a/apis/python/src/tiledbsoma/options/_soma_tiledb_context.py +++ b/apis/python/src/tiledbsoma/options/_soma_tiledb_context.py @@ -155,14 +155,9 @@ def timestamp(self) -> Optional[datetime.datetime]: def native_context(self) -> clib.SOMAContext: """The C++ SOMAContext for this SOMA context.""" with self._lock: - if self._native_context is not None: - return self._native_context - - # tiledb_config also acquires the lock so we must first release it and - # then reacquire it - cfg = self.tiledb_config - with self._lock: - self._native_context = clib.SOMAContext({k: str(cfg[k]) for k in cfg}) + if self._native_context is None: + cfg = self._internal_tiledb_config() + self._native_context = clib.SOMAContext({k: str(cfg[k]) for k in cfg}) return self._native_context @property