9

Bug introduced in 10.0.2 and fixed in 10.2.0


Since 10.0.2 some code that previously worked using named slots fail in very particular circumstances.

Attchd screenshot shows the issue w/ a particular Dataset which involves multiple pre-processing steps to construct, so cannot display here.

Lookup using form #name& fails, while the more normal forms or in Key form work.

enter image description here

However, it's difficult to reproduce this issue in a minimal example. When I try to project out a few rows and columns from this table to copy-paste it as text, subsequent re-casting to Dataset works w/ all forms of Slot.

Can anyone reproduce?

ilian
  • 25,474
  • 4
  • 117
  • 186
alancalvitti
  • 15,143
  • 3
  • 27
  • 92
  • Well, I haven't been able to reproduce this so far. I'd like to remark that you can drop the double quotes in the last slot form. – Sjoerd C. de Vries Dec 11 '14 at 22:09
  • What's the Dataset`GetType of byVisit? My debugging process for these things would be to do Normal[Query[All,#KinectSyncTime&]] to get the compiled query, then do compiledquery ** type to see what the type inference thinks (it will yield a FailureType judging by the error you saw). – Taliesin Beynon Dec 11 '14 at 23:11

1 Answers1

7

Following discussion w/ Jason Grigsby at WRI, rather than edit the Q w/ additional detail, the conclusion is that composite Keys such as lists of strings, interfere with above-mentioned named slot access:

data = <|"a" -> 1, {"b", "c"} -> 2|> // Dataset;

data[#["a"] &]

1

while

data[#"a" &]
Failure[Function, 
Association[
 "MessageTemplate" :> MessageName[Function, "slot1"], 
  "MessageParameters" -> {"a", Slot["a"]& , 
TypeSystem`SkeletonForm[
TypeSystem`Assoc[TypeSystem`AnyType, 
TypeSystem`Atom[Integer], 2]]}]]
alancalvitti
  • 15,143
  • 3
  • 27
  • 92
  • This is now fixed. Thanks for reporting! – Taliesin Beynon Jul 02 '15 at 07:38
  • @TaliesinBeynon Can you confirm, that #"boing" is officially supported as alternative to #["boing"]? I ask because I need to review some things for named slots in the IntelliJ plugin anyway and I would like to support it completely. The documentation for Slot doesn't even mention the #"name" form. – halirutan Jul 23 '15 at 01:12
  • @halirutan if you look at FullForm[#"boing"] you'll see it is exactly the same as #boing -- they parse to the same thing. For some reason #"boing" is not documented. I've reported that as a bug. – Taliesin Beynon Jul 23 '15 at 20:17