NaN vs None in historical query results

Running the same historical query via both a Perspective binding and a scripted call to queryTagHistory, I’ve found that cells in the dataset that return None on float columns via Perspective are returning NaN via the scripted one.

The way I bumped into this was using a Wide, AsStored, IgnoreBadQuality=True, PreventInterpolation=False, Format=Dataset Perspective query with at least two float columns that change at different times. One will change first, and the other will have None until it eventually changes.

Then, creating a matching returnSize=-1, returnFormat=Wide, noInterpolation=False, ignoreBadQuality=True scripted query on the same tags and time range, those cells will have NaN.

I’m here grumbling since this broke one of my scripts that analyzes historical data and I lost a couple hours trying to figure out what was going on. Now I’ve updated that script to find NaN float cells via math.isnan() and treat them the same as cells with None and it’s all working again.

(Ignition 8.1.7)

1 Like