StackOverflowError on jsonEncode of dict containing Dataset

Relevant thread. Looks like encoding the dataset first may work.