columnnames = [
{
'Doff_Number':Doff_Number if Doff_Number else 0,
'Denier':Denier,
} for Doff_Number,Denier in system.dataset.toPyDataSet(value)
]
return columnnames
I think this will get you what you’re looking for, but it’s sort of dangerous depending on the type of the column.
For example, if Doff_Number
is a string column, and a row contains a value of "0"
in that column, then you’ll get String “0” instead of 0
because bool("0")
equates to True
. So you need to be aware of what type a given column is.