# system.tag.queryTagHistory / aggregationMode='Interpolation v7.9

**URL:** <https://forum.inductiveautomation.com/t/system-tag-querytaghistory-aggregationmode-interpolation-v7-9/101057>\
**Category:** Ignition\
**Tags:** vision\
**Created:** [January 17, 2025, 8:43pm UTC](https://forum.inductiveautomation.com/t/system-tag-querytaghistory-aggregationmode-interpolation-v7-9/101057 "2025-01-17T20:43:36Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![lrose](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/lrose/32/62724_2.png) [@lrose](https://forum.inductiveautomation.com/u/lrose)\
**Post date:** [January 17, 2025, 10:22pm UTC](https://forum.inductiveautomation.com/t/system-tag-querytaghistory-aggregationmode-interpolation-v7-9/101057/2 "2025-01-17T22:22:54Z")

</div>

> [@yidir](#):
>
> `aggregationMode='Interpolation'`

This is not how you turn on interpolation, and it is not a valid aggregate, the code just ignores it (well actually it tries/and fails to execute it as a custom python aggregation but I'm not sure if that is logged or it just fails silently.)

If it did throw an error, and it may, your except block would not catch it as it would be a Java Exception and not a Python Exception. You need to import `java.lang.Throwable` and add a catch for that to catch any Java Errors.

```python
    dataSet = system.tag.queryTagHistory(
        paths=tag_path,
        startDate = startTime,
        endDate = endTime,
        intervalSeconds = interval_seconds,
        returnFormat = 'Wide',
        noInterpolation = False
    )
    pyData = system.dataset.toPyDataSet(dataSet)

```

I have ommitted the exception handling from the sample script. For proper error handling in Ignition you should follow the advice given here:

> [@Using Java.net Socket](https://forum.inductiveautomation.com/t/using-java-net-socket/79962/21):
>
> That won't catch everything. And it mixes data types for e. I use (and strongly recommend) this construct (shown as if a library script): from java.lang import Throwable logger = system.util.getLogger(system.util.getProjectName() + '.' + \_\_name\_\_) def someTask(): try: someaction() except Throwable, t: # Throwable is the ultimate superclass of all java exceptions and errors logger.warn("some text for java", t) except Exception, e # Exception is python's superclass (technically Bas…

---

_[View the full topic](https://forum.inductiveautomation.com/t/system-tag-querytaghistory-aggregationmode-interpolation-v7-9/101057)._
