7
$\begingroup$

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?

$\endgroup$
12
$\begingroup$

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.

$\endgroup$
  • $\begingroup$ Stefan, was this bug introduced in 10.0.2? $\endgroup$ – Mr.Wizard Dec 22 '14 at 23:25
  • 1
    $\begingroup$ @Mr.Wizard I just tried the use case in 10.0.1 and it worked. So it appears to be a regression in 10.0.2. $\endgroup$ – WReach Dec 23 '14 at 0:16
  • $\begingroup$ @Mr.Wizard, concur w/ WReach, worked in 10.0.1. $\endgroup$ – alancalvitti Dec 23 '14 at 15:25
  • $\begingroup$ @Stefan, +1 for quick recognition of the issue. Will your dev team consider more thorough testing w/ Dataset because of its type system complications? Titanic and Planets are toy models. $\endgroup$ – alancalvitti Dec 23 '14 at 15:29
  • $\begingroup$ @Mr.Wizard yes this appears to be a bug introduced in 10.0.2. $\endgroup$ – Stefan R Dec 23 '14 at 21:28
0
$\begingroup$

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

Up to a fix only a workaround might help

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.