{"record":{"id":"d663c2005cb23c94","repo":"pathwaycom/pathway","slug":"statistical-diff-invalid-column-reference-for-t-d663c2","errorCode":null,"errorMessage":"statistical.diff(): Invalid column reference for the parameter timestamp.","messagePattern":"statistical\\.diff\\(\\): Invalid column reference for the parameter timestamp\\.","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/pathway/stdlib/ordered/diff.py","lineNumber":93,"sourceCode":"    >>> pw.debug.compute_and_print(table, include_id=False)\n    timestamp | instance | values | diff_values\n    1         | 0        | 1      |\n    2         | 1        | 2      |\n    3         | 0        | 7      | 6\n    3         | 1        | 4      | 2\n    6         | 0        | 16     | 9\n    6         | 1        | 11     | 7\n    \"\"\"\n\n    if isinstance(timestamp, pw.ColumnReference):\n        timestamp = self[timestamp]\n    else:\n        if isinstance(timestamp, str):\n            raise ValueError(\n                \"statistical.diff(): Invalid column reference for the parameter timestamp,\"\n                + f\" found a string. Did you mean this.{timestamp} instead of {repr(timestamp)}?\"\n            )\n        raise ValueError(\n            \"statistical.diff(): Invalid column reference for the parameter timestamp.\"\n        )\n\n    ordered_table = self.sort(key=timestamp, instance=instance)\n\n    for value in values:\n        if isinstance(value, pw.ColumnReference):\n            value = self[value]\n        else:\n            if isinstance(value, str):\n                raise ValueError(\n                    \"statistical.diff(): Invalid column reference for the parameter value,\"\n                    + f\" found a string. Did you mean this.{value} instead of {repr(value)}?\"\n                )\n            raise ValueError(\n                \"statistical.diff(): Invalid column reference for the parameter value.\"\n            )\n","sourceCodeStart":75,"sourceCodeEnd":111,"githubUrl":"https://github.com/pathwaycom/pathway/blob/fa2f74a4649b7c5908690cf60137263d8d80de5f/python/pathway/stdlib/ordered/diff.py#L75-L111","documentation":"Error \"statistical.diff(): Invalid column reference for the parameter timestamp.\" thrown in pathwaycom/pathway.","triggerScenarios":"Thrown at python/pathway/stdlib/ordered/diff.py:93 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass a ColumnReference for the timestamp parameter, e.g. this.timestamp or <table>.timestamp."],"exampleFix":"pw.stdlib.statistical.diff(this.timestamp, this.value)","handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"fa2f74a4649b7c5908690cf60137263d8d80de5f","analyzedAt":"2026-08-15T01:48:17.006Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}