Convert tag data set to pds through scripting

How do I convert a tag data set to a pds data set through scripting?

Currently I assign the tag data set to a table and then convert the tables data set to pds.

tagValue = system.tag.read("MyTag").value
pds = system.dataset.toPyDataSet(tagValue)
1 Like

Thanks. I was leaving off the “.value” it was driving me crazy