Skip to content

Commit e6a88c4

Browse files
authored
Fix inconsistent null handling in DataFrame Arithmetics (#6770)
* Fix inconsistent null handling in DataFrame Arithmetics * Fix Null Count and division by zero issues * Minor changes to restart build and rerun flaky tests
1 parent aaf226c commit e6a88c4

File tree

4 files changed

+1078
-95
lines changed

4 files changed

+1078
-95
lines changed

src/Microsoft.Data.Analysis/PrimitiveColumnContainerHelpers.cs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,14 @@ internal static class PrimitiveColumnContainerHelpers
1111
internal static DataFrameBuffer<T> GetOrCreateMutable<T>(this IList<ReadOnlyDataFrameBuffer<T>> bufferList, int index)
1212
where T : unmanaged
1313
{
14-
ReadOnlyDataFrameBuffer<T> sourceBuffer = bufferList[index];
15-
DataFrameBuffer<T> mutableBuffer = sourceBuffer as DataFrameBuffer<T>;
14+
var sourceBuffer = bufferList[index];
1615

17-
if (mutableBuffer == null)
16+
if (sourceBuffer is not DataFrameBuffer<T> mutableBuffer)
1817
{
1918
mutableBuffer = DataFrameBuffer<T>.GetMutableBuffer(sourceBuffer);
2019
bufferList[index] = mutableBuffer;
2120
}
2221

23-
2422
return mutableBuffer;
2523
}
2624
}

0 commit comments

Comments
 (0)