pathwaycom/pathway · error · ValueError
statistical.diff(): Invalid column reference for the paramet
Error message
statistical.diff(): Invalid column reference for the parameter value, found a string. Did you mean this.{value} instead of {repr(value)}? What it means
Error "statistical.diff(): Invalid column reference for the parameter value, found a string. Did you mean this.{value} instead of {repr(value)}?" thrown in pathwaycom/pathway.
Source
Thrown at python/pathway/stdlib/ordered/diff.py:104
timestamp = self[timestamp]
else:
if isinstance(timestamp, str):
raise ValueError(
"statistical.diff(): Invalid column reference for the parameter timestamp,"
+ f" found a string. Did you mean this.{timestamp} instead of {repr(timestamp)}?"
)
raise ValueError(
"statistical.diff(): Invalid column reference for the parameter timestamp."
)
ordered_table = self.sort(key=timestamp, instance=instance)
for value in values:
if isinstance(value, pw.ColumnReference):
value = self[value]
else:
if isinstance(value, str):
raise ValueError(
"statistical.diff(): Invalid column reference for the parameter value,"
+ f" found a string. Did you mean this.{value} instead of {repr(value)}?"
)
raise ValueError(
"statistical.diff(): Invalid column reference for the parameter value."
)
ordered_table += ordered_table.select(
diff=pw.require(
value
- pw.unwrap(self.ix(ordered_table.prev, optional=True)[value._name]),
value,
ordered_table.prev,
)
)
ordered_table = ordered_table.rename({"diff": "diff_" + value.name})
View on GitHub (pinned to fa2f74a464)
Solutions
- Pass a ColumnReference for the value parameter, e.g. this.value or <table>.value instead of a string.
Example fix
pw.stdlib.statistical.diff(this.timestamp, this.value)
When it happens
Trigger: Thrown at python/pathway/stdlib/ordered/diff.py:104 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of pathwaycom/pathway@fa2f74a464 (2026-08-15).
Data as JSON: /api/errors/444ad5d11eb251f3.
Report an issue: GitHub.