Skip to content

Commit

Permalink
Fix crash when exporting to Arrow
Browse files Browse the repository at this point in the history
  • Loading branch information
st-pasha committed Nov 28, 2023
1 parent 1e50a35 commit 1757944
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ docs/_build/
!.idea/inspectionProfiles
*.sublime-*
.DS_Store
.vscode

# Landfill area
temp/
Expand Down
10 changes: 5 additions & 5 deletions src/core/frame/to_arrow.cc
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,10 @@ oobj Frame::to_arrow(const XArgs&) {
const Column& col = dt->get_column(i);
std::unique_ptr<dt::OArrowArray> aarr = col.to_arrow();
std::unique_ptr<dt::OArrowSchema> osch = col.to_arrow_schema();
arrays.set(i,
pa_Array.invoke("_import_from_c", {
oint(aarr.release()->intptr()),
oint(osch.release()->intptr())
}));
auto aarr_int = aarr.release()->intptr();
auto osch_int = osch.release()->intptr();
auto res = pa_Array.invoke("_import_from_c", {oint(aarr_int), oint(osch_int)});
arrays.set(i, res);
}

otuple names = dt->get_pynames();
Expand Down Expand Up @@ -125,6 +124,7 @@ std::unique_ptr<dt::OArrowArray> Column::to_arrow() const {


static void release_arrow_schema(dt::ArrowSchema* schema) {
schema->release = nullptr;
delete schema;
}

Expand Down

0 comments on commit 1757944

Please sign in to comment.