20

Bug introduced in 10.2 and fixed in 10.2 (by paclet update GeneralUtilities 10.2.1)


This is probably patch code in 10.2. Is there a way to turn off print with Transpose?

ds = <|"k1" -> <|"a" -> 1, "b" -> 2|>, 
   "k2" -> <|"a" -> 3, "b" -> 4|>|> // Dataset

enter image description here

ds[Transpose]

{a,b}{k1,k2}{{1,3},{2,4}}

enter image description here

This only affects Dataset :

ds // Normal // Transpose // Dataset 

enter image description here

Michael E2
  • 235,386
  • 17
  • 334
  • 747
alancalvitti
  • 15,143
  • 3
  • 27
  • 92

2 Answers2

13

As a stop-gap, one can use Block to turn off Print:

Block[{Print}, ds[Transpose]]
Michael E2
  • 235,386
  • 17
  • 334
  • 747
12

Update

This problem has been fixed by a paclet update -- specifically version 10.2.1 of the GeneralUtilities paclet:

PacletFind["GeneralUtilities"] // PacletInformation //
  GeneralUtilities`ToAssociations // Dataset

paclet information screenshot

In chat, Arnoud Buzing stated that this patch will normally be loaded automatically during the weekly paclet update. He also offered the following steps to perform the update manually:

  1. Evaluate these expressions:

    PacletSiteUpdate /@ PacletSites[];
    PacletInstall /@ PacletFindRemote["WolframAutoUpdate"];
    PacletInstall /@ PacletFindRemote["GeneralUtilities"];
    
  2. Quit and restart the kernel.


Original Response

As we await a fix from WRI, we can remove the errant Print as follows:

Needs["GeneralUtilities`"]
DownValues[GeneralUtilities`AssociationTranspose] =
  DeleteCases[
    DownValues[GeneralUtilities`AssociationTranspose]
  , HoldPattern @
      Print[
        GeneralUtilities`General`PackagePrivate`ikeys
      , GeneralUtilities`General`PackagePrivate`keys
      , GeneralUtilities`General`PackagePrivate`vals
      ]
  , Infinity
  ]

Naturally, this will void your warranty...

WReach
  • 68,832
  • 4
  • 164
  • 269