20
$\begingroup$

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

$\endgroup$
  • 1
    $\begingroup$ Block[{Print}, ds[Transpose]]? (Don't have V10.2 yet.) $\endgroup$ – Michael E2 Jul 14 '15 at 19:25
  • 8
    $\begingroup$ Yikes! Thanks for reporting this, we're looking into it! $\endgroup$ – Stefan R Jul 14 '15 at 19:41
  • 3
    $\begingroup$ Update: We're looking into fixing this via an automatic paclet update in the next few days. $\endgroup$ – Stefan R Jul 14 '15 at 21:26
13
$\begingroup$

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

Block[{Print}, ds[Transpose]]
$\endgroup$
11
$\begingroup$

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...

$\endgroup$
  • $\begingroup$ :-) what are the involved risks ? $\endgroup$ – chris Jul 19 '15 at 18:14
  • $\begingroup$ @chris Personally, I think the patch is perfectly safe. But obviously WRI aren't going to support it. $\endgroup$ – WReach Jul 19 '15 at 20:08

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.