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

Make dump calls conditional to fix errors when building against <2.26 #2062

Merged
merged 1 commit into from
Sep 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions tiledb/cc/attribute.cc
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,13 @@ void init_attribute(py::module &m) {
.def("_set_enumeration_name", set_enumeration_name)

.def("_dump", [](Attribute &attr) {
#if TILEDB_VERSION_MAJOR >= 2 && TILEDB_VERSION_MINOR >= 26
std::stringstream ss;
ss << attr;
return ss.str();
#else
attr.dump();
#endif
});
}

Expand Down
4 changes: 4 additions & 0 deletions tiledb/cc/domain.cc
Original file line number Diff line number Diff line change
Expand Up @@ -202,9 +202,13 @@ void init_domain(py::module &m) {
.def("_add_dim", &Domain::add_dimension, py::keep_alive<1, 2>())

.def("_dump", [](Domain &dom) {
#if TILEDB_VERSION_MAJOR >= 2 && TILEDB_VERSION_MINOR >= 26
std::stringstream ss;
ss << dom;
return ss.str();
#else
dom.dump();
#endif
});
}

Expand Down
14 changes: 9 additions & 5 deletions tiledb/cc/filter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -104,11 +104,15 @@ void init_filter(py::module &m) {
TPY_ERROR_LOC("Unrecognized filter option to _get_option");
}
})
.def("_dump", [](Filter &filter) {
std::stringstream ss;
ss << filter;
return ss.str();
});
#if TILEDB_VERSION_MAJOR >= 2 && TILEDB_VERSION_MINOR >= 26
.def("_dump",
[](Filter &filter) {
std::stringstream ss;
ss << filter;
return ss.str();
})
#endif
;

py::class_<FilterList>(m, "FilterList")
.def(py::init<FilterList>())
Expand Down
4 changes: 4 additions & 0 deletions tiledb/cc/schema.cc
Original file line number Diff line number Diff line change
Expand Up @@ -174,9 +174,13 @@ void init_schema(py::module &m) {

.def("_dump",
[](ArraySchema &schema) {
#if TILEDB_VERSION_MAJOR >= 2 && TILEDB_VERSION_MINOR >= 26
std::stringstream ss;
ss << schema;
return ss.str();
#else
schema.dump();
#endif
})

.def("_ctx", &ArraySchema::context)
Expand Down
Loading