A query for "Count" returns a result of None for queryTagCalculations if history is not configured. This does not make sense. Why is the result of that query not zero since there are zero results in the time period?
The documentation for the "Count" query:
- "Count" - the number of "good", non-interpolated values per window.
My educated guess, because they're two distinct things.
Returning a value of 0 is Ignition indicating, positively, that the count was zero. Returning a value of
null is Ignition indicating that it doesn't know the count.
If you don't care about the difference, it's pretty easy to map nulls to zeroes. If you do care about the difference, you'll appreciate that we didn't remove that information for you.
That is a valid reasoning from your perspective, but from a developer's perspective, why would I rely on an undocumented feature, since it could have just been an oversight or unintended behavior which will be "fixed" in future releases? Are you saying this is expected behavior and will persist?
From my perspective the Pythonic behavior would be to throw an exception for the case where history is asked for a tag which does not have history.
Since this is 7.9 you can expect no further behavior changes, regardless of the original intent or even if it's a bug.
I understand that, but we are trying to move to 8.x as quickly as we can, so I'd like to have as few things break when we do as possible. Is this something that may break?
That I don't know... let me ping another developer who might have a better idea.
No, this behavior still exists in 8.x and is expected. What @PGriffith said is correct.
Ideally this should be documented. I also observed that you will get "None" results if you ask for Query or History results for a tag that doesn't exist. That should also be documented. I think a lot of people coming from a Python background would have expected an exception, especially for the case where the tag does not exist at all.