Skip to content

Commit 2f68de3

Browse files
committed
fix: convert ARROW_STREAM_NAME to CString for PyCapsule creation
1 parent 5da8efe commit 2f68de3

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/dataframe.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -971,7 +971,9 @@ impl PyDataFrame {
971971
// PyArrow imports the capsule it assumes ownership of the stream and
972972
// nulls out the capsule's internal pointer so the destructor does not
973973
// free it twice.
974-
PyCapsule::new(py, stream, Some(ARROW_STREAM_NAME)).map_err(Into::into)
974+
// ARROW_STREAM_NAME is a `&CStr`; PyCapsule::new expects an
975+
// `Option<CString>` for the name, so convert it here.
976+
PyCapsule::new(py, stream, Some(ARROW_STREAM_NAME.into())).map_err(Into::into)
975977
}
976978

977979
fn execute_stream(&self, py: Python) -> PyDataFusionResult<PyRecordBatchStream> {

0 commit comments

Comments
 (0)