Skip to content

Commit

Permalink
Use _internal_tiledb_config in native_context
Browse files Browse the repository at this point in the history
  • Loading branch information
nguyenv committed Feb 23, 2024
1 parent 5b8daae commit 308db98
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions apis/python/src/tiledbsoma/options/_soma_tiledb_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 308db98

Please sign in to comment.