From a8364a13fa9a2cdaceffb10cf1cd986d3bdb38c6 Mon Sep 17 00:00:00 2001 From: Agis Kounelis Date: Thu, 11 Apr 2024 23:18:50 +0300 Subject: [PATCH] Wrap tiledb_array_consolidate_fragments from pybind11 --- tiledb/cc/array.cc | 8 ++++++++ tiledb/tests/cc/test_cc.py | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 40 insertions(+) diff --git a/tiledb/cc/array.cc b/tiledb/cc/array.cc index 5fd55e9b73..7ace98ac5e 100644 --- a/tiledb/cc/array.cc +++ b/tiledb/cc/array.cc @@ -83,6 +83,14 @@ void init_array(py::module &m) { // TODO non_empty_domain_var .def("query_type", &Array::query_type) + .def("consolidate_fragments", [](Array &self, const Context &ctx, const std::vector &fragment_uris, Config *config) { + std::vector c_strings; + c_strings.reserve(fragment_uris.size()); + for(const auto& str : fragment_uris) { + c_strings.push_back(str.c_str()); + } + ctx.handle_error(tiledb_array_consolidate_fragments(ctx.ptr().get(), self.uri().c_str(), c_strings.data(), fragment_uris.size(), config->ptr().get())); + }) .def("consolidate_metadata", py::overload_cast