dotnet / dotnet/machinelearning

DataFrameColumn.GetReadOnlyDataBuffers doesn't work on .NET Framework

Open
#5,673 0 comments 0 reactions 0 assignees View on GitHub
area-DataFrame
Dominant language
C#
Stars
9.4k
Forks
2k
Avg merge
2d 20h
Merged PRs (30d)
11

Description

We are using `Unsafe.As` to cast a `Memory` to a `Memory`, and on .NET Framework this doesn't work.

https://github.com/dotnet/corefxlab/blob/86fa8eeb25d8e730ff204e3f017e230b802c9b50/src/Microsoft.Data.Analysis/ReadOnlyDataFrameBuffer.cs#L26-L33

Later, when we use this memory object, it throws:

```
System.InvalidCastException : Unable to cast object of type 'System.Byte[]' to type 'System.Int32[]'.
Stack Trace:
ReadOnlyMemory`1.get_Span()
BufferTests.TestArrowStringColumnGetReadOnlyBuffers() line 264
```

We need to figure out a better way to implement this method.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.