From fdf42071441d61f3d4db71bfd22b0afa63a31b10 Mon Sep 17 00:00:00 2001 From: kounelisagis Date: Thu, 11 Apr 2024 20:55:24 +0000 Subject: [PATCH] Wrap tiledb_array_consolidate_fragments from pybind11 --- tiledb/cc/array.cc | 12 ++++++++++++ tiledb/tests/cc/test_cc.py | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 44 insertions(+) diff --git a/tiledb/cc/array.cc b/tiledb/cc/array.cc index 5fd55e9b73..c804646f94 100644 --- a/tiledb/cc/array.cc +++ b/tiledb/cc/array.cc @@ -83,6 +83,18 @@ 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