Skip to content
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

Merged

Conversation

kounelisagis
Copy link
Member

No description provided.

Copy link
Collaborator

@nguyenv nguyenv left a 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.

Comment on lines 57 to 67
.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);
})
Copy link
Collaborator

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.

Copy link
Member Author

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.

config = tiledb.Config()

ctx = tiledb.Ctx(config=config)
lt_array = lt.Array(ctx, path, lt.QueryType.READ)
Copy link
Collaborator

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().

Copy link
Collaborator

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.

Copy link
Member Author

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.

@kounelisagis kounelisagis requested a review from nguyenv July 8, 2024 12:36
@kounelisagis kounelisagis merged commit 7353729 into dev Jul 8, 2024
34 checks passed
@kounelisagis kounelisagis deleted the agis/sc-44909/move-fragment-list-consolidation-api-to-pybind branch July 8, 2024 14:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants