CurtHagenlocher commented on code in PR #537:
URL: https://github.com/apache/arrow-dotnet/pull/537#discussion_r4801439946
##########
test/Apache.Arrow.Tests/CDataInterfacePythonTests.cs:
##########
@@ -1030,12 +1030,12 @@ public async Task ExportBatchReadFromIpc()
[SkippableFact]
public async Task EarlyDisposeOfExportedBatch()
{
- // Reading IPC data from a Stream creates Arrow buffers backed by
ReadOnlyMemory that point
- // to slices of a single memory buffer owned by the RecordBatch
(unless compression is used).
- // Using the exported data after the RecordBatch has been disposed
could cause
- // memory corruption or access violations.
+ // Reading IPC data from a Stream creates buffers that are slices
of the message body
+ // (unless compression is used). Each holds a reference to the
body, so the exported
+ // data keeps it alive after the RecordBatch has been disposed.
var originalBatch = GetTestRecordBatch();
+ dynamic pyBatch = GetPythonRecordBatch();
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]