diff --git a/apis/python/src/tiledbsoma/_dataframe.py b/apis/python/src/tiledbsoma/_dataframe.py index 6c3f605064..2aa8cd34d4 100644 --- a/apis/python/src/tiledbsoma/_dataframe.py +++ b/apis/python/src/tiledbsoma/_dataframe.py @@ -268,6 +268,7 @@ def create( plt_cfg.consolidate_and_vacuum = ops.consolidate_and_vacuum # TODO add as kw args + timestamp_ms = context._open_timestamp_ms(tiledb_timestamp) clib.SOMADataFrame.create( uri, schema, @@ -276,6 +277,7 @@ def create( extents, context.native_context, plt_cfg, + (0, timestamp_ms) ) handle = cls._wrapper_type.open(uri, "w", context, tiledb_timestamp) diff --git a/apis/python/src/tiledbsoma/soma_dataframe.cc b/apis/python/src/tiledbsoma/soma_dataframe.cc index 7b7b6895ab..f7f6823450 100644 --- a/apis/python/src/tiledbsoma/soma_dataframe.cc +++ b/apis/python/src/tiledbsoma/soma_dataframe.cc @@ -57,7 +57,8 @@ void load_soma_dataframe(py::module& m) { py::object py_domains, py::object py_extents, std::shared_ptr context, - std::optional platform_config) { + std::optional platform_config, + std::optional> timestamp) { ArrowSchema schema; uintptr_t schema_ptr = (uintptr_t)(&schema); py_schema.attr("_export_to_c")(schema_ptr); @@ -96,7 +97,8 @@ void load_soma_dataframe(py::module& m) { std::make_shared(domains), std::make_shared(extents)), context, - platform_config); + platform_config, + timestamp); } catch (const std::out_of_range& e) { throw py::type_error(e.what()); } catch (const std::exception& e) { diff --git a/apis/python/tests/test_collection.py b/apis/python/tests/test_collection.py index 39a6918ff8..75c792aa9e 100644 --- a/apis/python/tests/test_collection.py +++ b/apis/python/tests/test_collection.py @@ -486,6 +486,7 @@ def test_issue919(tmp_path): expt.add_new_dataframe( "df", schema=schema, index_column_names=["soma_joinid"] ) + assert expt["df"].tiledb_timestamp_ms == 100 with soma.Collection.open(uri, context=context) as c: assert "df" in c["expt"] and "causes_bug" in c["expt"] @@ -518,4 +519,4 @@ def test_context_timestamp(tmp_path: pathlib.Path): assert coll.tiledb_timestamp_ms == 234 sub_1 = coll["sub_1"] assert sub_1.tiledb_timestamp_ms == 234 - assert sub_1["sub_sub"].tiledb_timestamp_ms == 234 + assert sub_1["sub_sub"].tiledb_timestamp_ms == 234 \ No newline at end of file