CurtHagenlocher commented on code in PR #537:
URL: https://github.com/apache/arrow-dotnet/pull/537#discussion_r4801530085
##########
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);
+ }
CArrowArray.Free(cArray);
CArrowSchema.Free(cSchema);
Review Comment:
They're cleanup in a test that only matters when it's already failing, and
every test in the file frees this way.
--
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]