Skip to content
Merged
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
101 changes: 61 additions & 40 deletions python/perspective/perspective/src/view.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -412,11 +412,14 @@ namespace binding {
std::int32_t end_col,
bool compress
) {
PSP_GIL_UNLOCK();
PSP_READ_LOCK(view->get_lock());
std::shared_ptr<std::string> str = view->to_arrow(
start_row, end_row, start_col, end_col, true, compress
);
std::shared_ptr<std::string> str;
{
PSP_GIL_UNLOCK();
PSP_READ_LOCK(view->get_lock());
str = view->to_arrow(
start_row, end_row, start_col, end_col, true, compress
);
}
return py::bytes(*str);
}

Expand All @@ -429,11 +432,14 @@ namespace binding {
std::int32_t end_col,
bool compress
) {
PSP_GIL_UNLOCK();
PSP_READ_LOCK(view->get_lock());
std::shared_ptr<std::string> str = view->to_arrow(
start_row, end_row, start_col, end_col, true, compress
);
std::shared_ptr<std::string> str;
{
PSP_GIL_UNLOCK();
PSP_READ_LOCK(view->get_lock());
str = view->to_arrow(
start_row, end_row, start_col, end_col, true, compress
);
}
return py::bytes(*str);
}

Expand All @@ -446,11 +452,14 @@ namespace binding {
std::int32_t end_col,
bool compress
) {
PSP_GIL_UNLOCK();
PSP_READ_LOCK(view->get_lock());
std::shared_ptr<std::string> str = view->to_arrow(
start_row, end_row, start_col, end_col, true, compress
);
std::shared_ptr<std::string> str;
{
PSP_GIL_UNLOCK();
PSP_READ_LOCK(view->get_lock());
str = view->to_arrow(
start_row, end_row, start_col, end_col, true, compress
);
}
return py::bytes(*str);
}

Expand All @@ -463,11 +472,14 @@ namespace binding {
std::int32_t end_col,
bool compress
) {
PSP_GIL_UNLOCK();
PSP_READ_LOCK(view->get_lock());
std::shared_ptr<std::string> str = view->to_arrow(
start_row, end_row, start_col, end_col, true, compress
);
std::shared_ptr<std::string> str;
{
PSP_GIL_UNLOCK();
PSP_READ_LOCK(view->get_lock());
str = view->to_arrow(
start_row, end_row, start_col, end_col, true, compress
);
}
return py::bytes(*str);
}

Expand Down Expand Up @@ -530,41 +542,50 @@ namespace binding {

py::bytes
get_row_delta_unit(std::shared_ptr<View<t_ctxunit>> view) {
PSP_GIL_UNLOCK();
PSP_READ_LOCK(view->get_lock());
std::shared_ptr<t_data_slice<t_ctxunit>> slice = view->get_row_delta();
std::shared_ptr<std::string> arrow =
view->data_slice_to_arrow(slice, false, false);
std::shared_ptr<std::string> arrow;
{
PSP_GIL_UNLOCK();
PSP_READ_LOCK(view->get_lock());
std::shared_ptr<t_data_slice<t_ctxunit>> slice =
view->get_row_delta();
arrow = view->data_slice_to_arrow(slice, false, false);
}
return py::bytes(*arrow);
}

py::bytes
get_row_delta_zero(std::shared_ptr<View<t_ctx0>> view) {
PSP_GIL_UNLOCK();
PSP_READ_LOCK(view->get_lock());
std::shared_ptr<t_data_slice<t_ctx0>> slice = view->get_row_delta();
std::shared_ptr<std::string> arrow =
view->data_slice_to_arrow(slice, false, false);
std::shared_ptr<std::string> arrow;
{
PSP_GIL_UNLOCK();
PSP_READ_LOCK(view->get_lock());
std::shared_ptr<t_data_slice<t_ctx0>> slice = view->get_row_delta();
arrow = view->data_slice_to_arrow(slice, false, false);
}
return py::bytes(*arrow);
}

py::bytes
get_row_delta_one(std::shared_ptr<View<t_ctx1>> view) {
PSP_GIL_UNLOCK();
PSP_READ_LOCK(view->get_lock());
std::shared_ptr<t_data_slice<t_ctx1>> slice = view->get_row_delta();
std::shared_ptr<std::string> arrow =
view->data_slice_to_arrow(slice, false, false);
std::shared_ptr<std::string> arrow;
{
PSP_GIL_UNLOCK();
PSP_READ_LOCK(view->get_lock());
std::shared_ptr<t_data_slice<t_ctx1>> slice = view->get_row_delta();
arrow = view->data_slice_to_arrow(slice, false, false);
}
return py::bytes(*arrow);
}

py::bytes
get_row_delta_two(std::shared_ptr<View<t_ctx2>> view) {
PSP_GIL_UNLOCK();
PSP_READ_LOCK(view->get_lock());
std::shared_ptr<t_data_slice<t_ctx2>> slice = view->get_row_delta();
std::shared_ptr<std::string> arrow =
view->data_slice_to_arrow(slice, false, false);
std::shared_ptr<std::string> arrow;
{
PSP_GIL_UNLOCK();
PSP_READ_LOCK(view->get_lock());
std::shared_ptr<t_data_slice<t_ctx2>> slice = view->get_row_delta();
arrow = view->data_slice_to_arrow(slice, false, false);
}
return py::bytes(*arrow);
}

Expand Down