[BUG]"columnNames" Parameter Not Working for Tag History

Issue Description:

When defining the “columnNames” parameter for the “system.historian.queryAggregatedPoints” function, the resulting dataset does not use the value of “columnNames” for its headers but instead the default header names. I tested this in a Python script within the Reporting module and the Script Console.

Expected Behavior:

The resulting dataset should have its headers replaced with the list of strings defined in “columnNames”. The function does return an exception when the length of the list is not correct, which is expected.

I was able to replicate the “columnNames” functionality with the “setColumnNames” dataset method in my script, but I don’t know why the parameter in the function does not work.

Ignition Version: 8.3.1

Please post your test script and see Wiki - how to post code on this forum.

I think you need to account for the first column in the return dataset. IIRC, it’s a ts/t_stamp column.

How many columns are in your return dataset vs your columnNames?

This is the code I was using to test in the Script Console:

histPath = "histprov:NBU_Main_DB:/sys:NBU_Main:/prov:NBU_Main:/tag:_Gateway/Performance/CPU Usage"
tagPath = "[NBU_Main]_Gateway/Performance/CPU Usage"

output1 = system.historian.queryAggregatedPoints(
	paths = [histPath],
	startTime = system.date.addDays(system.date.now(), -1),
	endTime = system.date.now()
)
print("Dataset with default headers: ")
print(output1.getColumnNames())
print(list(output1))

output2 = system.historian.queryAggregatedPoints(
	paths = [histPath],
	startTime = system.date.addDays(system.date.now(), -1),
	endTime = system.date.now(),
	columnNames = [tagPath]
)
print("Dataset with new headers: ")
print(output2.getColumnNames())
print(list(output2))

Result:

Dataset with default headers: 
[t_stamp, histprov:NBU_Main_DB:/sys:NBU_Main:/prov:NBU_Main:/tag:_Gateway/Performance/CPU Usage]
[[Sun Nov 23 15:46:41 CST 2025, 0.13377929849728076]]
Dataset with new headers: 
[t_stamp, histprov:NBU_Main_DB:/sys:NBU_Main:/prov:NBU_Main:/tag:_Gateway/Performance/CPU Usage]
[[Sun Nov 23 15:46:41 CST 2025, 0.13377952958085207]]

I’m only using one column in columnNames because I get an exception when adding more.

Example:

histPath = "histprov:NBU_Main_DB:/sys:NBU_Main:/prov:NBU_Main:/tag:_Gateway/Performance/CPU Usage"
tagPath = "[NBU_Main]_Gateway/Performance/CPU Usage"

output1 = system.historian.queryAggregatedPoints(
	paths = [histPath],
	startTime = system.date.addDays(system.date.now(), -1),
	endTime = system.date.now()
)
print("Dataset with default headers: ")
print(output1.getColumnNames())
print(list(output1))

output2 = system.historian.queryAggregatedPoints(
	paths = [histPath],
	startTime = system.date.addDays(system.date.now(), -1),
	endTime = system.date.now(),
	columnNames = ["t_stamp", tagPath]
)
print("Dataset with new headers: ")
print(output2.getColumnNames())
print(list(output2))

Result:

Dataset with default headers: 
[t_stamp, histprov:NBU_Main_DB:/sys:NBU_Main:/prov:NBU_Main:/tag:_Gateway/Performance/CPU Usage]
[[Sun Nov 23 15:48:34 CST 2025, 0.1348958872269098]]
Java Traceback:
Traceback (most recent call last):
  File "<input>", line 13, in <module>
	at com.inductiveautomation.historian.common.scripting.AbstractHistorianFunctions.queryAggregatedPoints(AbstractHistorianFunctions.kt:200)

	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

	at java.base/java.lang.reflect.Method.invoke(Unknown Source)

java.lang.IllegalArgumentException: java.lang.IllegalArgumentException: The paths and columnNames lists must be the same size


	at org.python.core.Py.JavaError(Py.java:545)

	at org.python.core.Py.JavaError(Py.java:536)

	at org.python.core.PyReflectedFunction.__call__(PyReflectedFunction.java:192)

	at com.inductiveautomation.ignition.common.script.ScriptManager$ReflectedInstanceFunction.__call__(ScriptManager.java:563)

	at org.python.core.PyObject.__call__(PyObject.java:400)

	at org.python.pycode._pyx42.f$0(<input>:21)

	at org.python.pycode._pyx42.call_function(<input>)

	at org.python.core.PyTableCode.call(PyTableCode.java:173)

	at org.python.core.PyCode.call(PyCode.java:18)

	at org.python.core.Py.runCode(Py.java:1703)

	at org.python.core.Py.exec(Py.java:1747)

	at org.python.util.PythonInterpreter.exec(PythonInterpreter.java:277)

	at org.python.util.InteractiveInterpreter.runcode(InteractiveInterpreter.java:130)

	at com.inductiveautomation.ignition.designer.gui.tools.jythonconsole.JythonConsole$ConsoleWorker.doInBackground(JythonConsole.java:628)

	at com.inductiveautomation.ignition.designer.gui.tools.jythonconsole.JythonConsole$ConsoleWorker.doInBackground(JythonConsole.java:616)

	at java.desktop/javax.swing.SwingWorker$1.call(Unknown Source)

	at java.base/java.util.concurrent.FutureTask.run(Unknown Source)

	at java.desktop/javax.swing.SwingWorker.run(Unknown Source)

	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)

	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)

	at java.base/java.lang.Thread.run(Unknown Source)

Caused by: java.lang.IllegalArgumentException: The paths and columnNames lists must be the same size

	at com.inductiveautomation.historian.common.scripting.AbstractHistorianFunctions.queryAggregatedPoints(AbstractHistorianFunctions.kt:200)

	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

	at java.base/java.lang.reflect.Method.invoke(Unknown Source)

	at org.python.core.PyReflectedFunction.__call__(PyReflectedFunction.java:190)

	... 18 more

Traceback (most recent call last):
  File "<input>", line 13, in <module>
	at com.inductiveautomation.historian.common.scripting.AbstractHistorianFunctions.queryAggregatedPoints(AbstractHistorianFunctions.kt:200)

	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

	at java.base/java.lang.reflect.Method.invoke(Unknown Source)

java.lang.IllegalArgumentException: java.lang.IllegalArgumentException: The paths and columnNames lists must be the same size

The stacktrace says:

Here's why.

Tip: When confronted to a java stacktrace, look for the lines that start with "caused by"