-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Move fragment list consolidation API to pybind #1999
Move fragment list consolidation API to pybind #1999
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm. I only have one minor comment.
tiledb/cc/array.cc
Outdated
.def("consolidate", | ||
py::overload_cast<const Context &, const std::string &, | ||
Config *const>(&Array::consolidate), | ||
py::call_guard<py::gil_scoped_release>()) | ||
[](Array &self) { | ||
if (self.query_type() == TILEDB_READ) { | ||
throw TileDBError("cannot consolidate array opened in readonly " | ||
"mode (mode='r')"); | ||
} | ||
|
||
Config config; | ||
Context ctx; | ||
Array::consolidate(ctx, self.uri(), &config); | ||
}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we should have this one. The default context should be coming from the already existing tiledb.default_ctx()
rather than constructing a new tiledb::Context
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But if we delete this, we cannot have calls like array.consolidate()
without any arguments.
This can be done with current implementation.
tiledb/tests/test_libtiledb.py
Outdated
config = tiledb.Config() | ||
|
||
ctx = tiledb.Ctx(config=config) | ||
lt_array = lt.Array(ctx, path, lt.QueryType.READ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah ok I did not catch this before. The underlying tiledb.cc
(lt
) bindings are not meant to be public. The user should still be using tiledb.Array
. For example, tiledb.ArraySchema
inherits from lt.Schema
. And this way we can set the default ctx to tiledb.default_ctx()
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What I think is that the static tiledb.consolidate
method can be in Pybind11, but we still need the Cython tiledb.libtiledb.Array.consolidate
method. Otherwise, to create a pure Python Array
class as we did for ArraySchema
, you would need to move everything in the Array
class out of Cython and into Pybind11 which is a TON of work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's exactly the problem. That's the reason that it wasn't clear what to do with that story.
No description provided.