diff --git a/apis/python/src/tiledbsoma/_sparse_nd_array.py b/apis/python/src/tiledbsoma/_sparse_nd_array.py index 6782d48299..37e3b0e973 100644 --- a/apis/python/src/tiledbsoma/_sparse_nd_array.py +++ b/apis/python/src/tiledbsoma/_sparse_nd_array.py @@ -161,8 +161,11 @@ def read( self._check_open_read() _util.check_unpartitioned(partitions) - config = handle.config().copy() - config.update(platform_config or {}) + context = handle.context() + if platform_config is not None: + config = context.tiledb_config.copy() + config.update(platform_config or {}) + context = clib.SOMAContext(config) ts = None if handle.timestamp is not None: @@ -171,7 +174,7 @@ def read( sr = clib.SOMASparseNDArray.open( uri=handle.uri, mode=clib.OpenMode.read, - platform_config=config, + context=context, column_names=[], result_order=_util.to_clib_result_order(result_order), timestamp=ts, diff --git a/apis/python/src/tiledbsoma/_tdb_handles.py b/apis/python/src/tiledbsoma/_tdb_handles.py index 0248663cdc..fdb722bcd9 100644 --- a/apis/python/src/tiledbsoma/_tdb_handles.py +++ b/apis/python/src/tiledbsoma/_tdb_handles.py @@ -74,6 +74,8 @@ def open( return DataFrameWrapper._from_soma_object(soma_object, context) elif open_mode == clib.OpenMode.read and obj_type == "SOMADenseNDArray": return DenseNDArrayWrapper._from_soma_object(soma_object, context) + elif open_mode == clib.OpenMode.read and obj_type == "SOMASparseNDArray": + return SparseNDArrayWrapper._from_soma_object(soma_object, context) if obj_type in ( "SOMADataFrame", diff --git a/apis/python/src/tiledbsoma/_tiledb_object.py b/apis/python/src/tiledbsoma/_tiledb_object.py index 288cd03bc3..54591869c8 100644 --- a/apis/python/src/tiledbsoma/_tiledb_object.py +++ b/apis/python/src/tiledbsoma/_tiledb_object.py @@ -42,7 +42,7 @@ class TileDBObject(somacore.SOMAObject, Generic[_WrapperType_co]): """Class variable of the Wrapper class used to open this object type.""" _wrapper_type: Type[_WrapperType_co] _reader_wrapper_type: Union[ - Type[_WrapperType_co], Type[_tdb_handles.DataFrameWrapper] + Type[_WrapperType_co], Type[_tdb_handles.SOMAArrayWrapper] ] __slots__ = ("_close_stack", "_handle") diff --git a/apis/python/src/tiledbsoma/soma_sparse_ndarray.cc b/apis/python/src/tiledbsoma/soma_sparse_ndarray.cc index 38c8331265..417d42b319 100644 --- a/apis/python/src/tiledbsoma/soma_sparse_ndarray.cc +++ b/apis/python/src/tiledbsoma/soma_sparse_ndarray.cc @@ -60,7 +60,7 @@ void load_soma_sparse_ndarray(py::module &m) { std::optional>>(&SOMASparseNDArray::open), "uri"_a, "mode"_a, - "ctx"_a, + "context"_a, py::kw_only(), "column_names"_a = py::none(), "result_order"_a = ResultOrder::automatic,