I have a dataset set to a custom param that I want to go through and remove rows where the IsValid column is true.
I think I can do this through a script transform
def transform(self, value, quality, timestamp): valueDataset = system.dataset.toPyDataSet(value) validRows = [row for row in valueDataset if row['IsValid'] == True] return validRows
This works with returning the rows, but I need it back as a regular dataset. I tried toDataSet
filteredDataset = system.dataset.toDataSet(validRows) return filteredDataset
but I'm getting a ScriptEval error because I think I need to give it column headers, which I have no idea how to do that.
edit: that being said, I feel like there should/could be a more elegant way of doing this, as I lose the column names when I convert toPyDataSet.
Thanks for the help!