pathwaycom/pathway · error · ValueError

statistical.diff(): Invalid column reference for the paramet

Error message

statistical.diff(): Invalid column reference for the parameter value.

What it means

Error "statistical.diff(): Invalid column reference for the parameter value." thrown in pathwaycom/pathway.

Source

Thrown at python/pathway/stdlib/ordered/diff.py:108

                "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})

    return ordered_table.without(ordered_table.prev, ordered_table.next)

View on GitHub (pinned to fa2f74a464)

Solutions

  1. Pass a ColumnReference for the value parameter (not a literal or other expression type).

Example fix

pw.stdlib.statistical.diff(this.timestamp, this.value)

When it happens

Trigger: Thrown at python/pathway/stdlib/ordered/diff.py:108 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/d05d1d1924a58633. Report an issue: GitHub.