Deedle icon indicating copy to clipboard operation
Deedle copied to clipboard

Accessing virtual frame creates series with different length of keys and values

Open zyzhu opened this issue 7 years ago • 0 comments

See discussions in #330. The following test case created series of 3 keys and 2 values when accessing f.GetRow<obj>(5000001L).["Times"]. Created this issue to track how to fix it.

[<Test>]
let ``Can add computed series as a new column to a frame with the same index``() = 
  let s1, s2, f = createNumericFrame()
  let times = f |> Frame.mapRows (fun _ row -> 
    let t = row.GetAs<int64>("Dense")
    DateTimeOffset(DateTime(2000,1,1).AddTicks(t * 1233456789L), TimeSpan.FromHours(1.0)) )
  f.AddColumn("Times", times)
  f.GetRow<obj>(5000001L).["Dense"] |> shouldEqual (box 5000001L)
  f.GetRow<obj>(5000001L).TryGet("Sparse") |> shouldEqual OptionalValue.Missing
  (f.GetRow<obj>(5000001L).["Times"] |> unbox<DateTimeOffset>).Year |> shouldEqual 2019
  set s1.AccessList |> shouldEqual <| set [5000001L]
  set s2.AccessList |> shouldEqual <| set [5000001L]

zyzhu avatar Aug 20 '18 13:08 zyzhu