7

Bug introduced in 10.0.2


The warning below seems unrelated to these issues: Did 10.0.2 break some forms for named slots? and 10.0.2 mapping Association to Dataset warning.

First noticed w/ TimeObject but that turns out a red herring:

data = List[Association[Rule["WEBCAM_TIME",TimeObject[List[0,12,27.9`]]],Rule["VisitStartTime",TimeObject[List[0,12,15.`]]]],Association[Rule["WEBCAM_TIME",TimeObject[List[0,12,28.`]]],Rule["VisitStartTime",TimeObject[List[0,12,15.`]]]]];

Dataset[data] 

enter image description here

Below, named Slot lookup syntax makes no difference, eg #[x] versus #x, nor <|...|> versus Association:

Dataset[data][All, 
 Association[#, "time" -> #["WEBCAM_TIME"] - #["VisitStartTime"]] &]

Keys::invrl: The argument Keys[Association[Struct[{WEBCAM_TIME,Atom[String]},{Atom[TimeObject],Atom[TimeObject]}],time->-Struct[{WEBCAM_TIME,VisitStartTime},{Atom[<<1>>],Atom[<<1>>]}][VisitStartTime]+Struct[{WEBCAM_TIME,VisitStartTime},{Atom[TimeObject],Atom[TimeObject]}][WEBCAM_TIME]]] is not a valid Association or a list of rules. >>

and similarly for Values::invrl, even though "time" is handled correctly:

enter image description here

Finally, casting TimeObject to AbsoluteTime makes no diff either, eg:

Dataset[data][All, All, AbsoluteTime][All, 
 Association[#, "time" -> #["WEBCAM_TIME"] - #["VisitStartTime"]] &] 

enter image description here

Gives a similar warning but refers to Atom[Real] and Atom[Integer] as per AbsoluteTime.

Is this another type inference fault?

alancalvitti
  • 15,143
  • 3
  • 27
  • 92

2 Answers2

12

This is a bug, although I cannot confirm if it is directly related to the named slot issues previously mentioned.

This is fixed in our latest internal development builds, though. I'll make sure we add this to our suite of tests for Dataset.

Stefan R
  • 2,136
  • 18
  • 17
0

Seems to related to the bug mentioned here: Appending in Dataset.

Up to a fix only a workaround might help

mgamer
  • 5,593
  • 18
  • 26