fslaborg / Deedle

Easy to use .NET library for data and time series manipulation and for scientific programming
http://fslab.org/Deedle/
BSD 2-Clause "Simplified" License
924 stars 196 forks source link

"Select not supported" for GetRowsAs<'T> #545

Open brianberns opened 2 years ago

brianberns commented 2 years ago

Consider the following code:

type IRecord =
    abstract member MyString : string
    abstract member MyInt : int

let df =
    Frame.ofRecords [
        {| MyString = "One"; MyInt = "1" |}
        {| MyString = "Two"; MyInt = "2" |}
    ]
let series =
    df.GetRowsAs<IRecord>()
        |> Series.mapValues id

I would expect this to run successfully, but instead it results in the following exception:

Unhandled exception. System.Exception: mapFrameRowVector: Select not supported
   at Deedle.VectorHelpers.mapFrameRowVector@516.Deedle.IVector<'TRow>.Select[a](FSharpFunc`2 g) in src\Deedle\Vectors\VectorHelpers.fs:line 522
   at Deedle.Series`2.SelectOptional[R](Func`2 f) in src\Deedle\Series.fs:line 415
   at Deedle.Series`2.Select[R](Func`2 f) in src\Deedle\Series.fs:line 399
   at Deedle.SeriesModule.MapValues[T,R,K](FSharpFunc`2 f, Series`2 series) in src\Deedle\SeriesModule.fs:line 462
   at <StartupCode$DeedleTest>.$Program.main@() in Program.fs:line 16