pitrou commented on code in PR #5080:
URL: https://github.com/apache/arrow-rs/pull/5080#discussion_r1399102927


##########
arrow/src/ffi.rs:
##########
@@ -234,46 +235,59 @@ pub fn to_ffi(data: &ArrayData) -> 
Result<(FFI_ArrowArray, FFI_ArrowSchema)> {
 ///
 /// This struct assumes that the incoming data agrees with the C data 
interface.
 pub fn from_ffi(array: FFI_ArrowArray, schema: &FFI_ArrowSchema) -> 
Result<ArrayData> {
+    let dt = DataType::try_from(schema)?;
     let array = Arc::new(array);
-    let tmp = ArrowArray {
+    let tmp = ImportedArrowArray {
         array: &array,
-        schema,
+        data_type: dt,
+        owner: &array,
+    };
+    tmp.consume()
+}
+
+/// Import [ArrayData] from the C Data Interface
+///
+/// # Safety
+///
+/// This struct assumes that the incoming data agrees with the C data 
interface.
+pub fn from_ffi_and_data_type(array: FFI_ArrowArray, data_type: DataType) -> 
Result<ArrayData> {

Review Comment:
   Ok, done.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to