CurtHagenlocher commented on code in PR #537:
URL: https://github.com/apache/arrow-dotnet/pull/537#discussion_r4801443522
##########
test/Apache.Arrow.Tests/CDataInterfacePythonTests.cs:
##########
@@ -1059,7 +1059,16 @@ public async Task EarlyDisposeOfExportedBatch()
CArrowSchema* cSchema = CArrowSchema.Create();
CArrowSchemaExporter.ExportSchema(batch.Schema, cSchema);
- Assert.Throws<InvalidOperationException>(() =>
batch.Dispose());
+ batch.Dispose();
+
+ long arrayPtr = ((IntPtr)cArray).ToInt64();
+ long schemaPtr = ((IntPtr)cSchema).ToInt64();
+ using (Py.GIL())
+ {
+ dynamic pa = Py.Import("pyarrow");
+ dynamic exportedPyBatch =
pa.RecordBatch._import_from_c(arrayPtr, schemaPtr);
+ Assert.True(exportedPyBatch == pyBatch);
+ }
Review Comment:
GetPythonRecordBatch acquires the GIL itself, and pyarrow's
RecordBatch.__eq__ calls equals, so this compares values. It matches the other
C Data import tests in this file.
--
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]