{"record":{"id":"1d688faa908480bb","repo":"pathwaycom/pathway","slug":"column-api-diff-pseudocolumn-can-only-have-1-and","errorCode":null,"errorMessage":"Column {api.DIFF_PSEUDOCOLUMN} can only have 1 and -1 values.","messagePattern":"Column (.+?) can only have 1 and -1 values\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/pathway/debug/__init__.py","lineNumber":320,"sourceCode":"    for pseudocolumn in api.PANDAS_PSEUDOCOLUMNS:\n        if pseudocolumn in df.columns:\n            if not pd.api.types.is_integer_dtype(df[pseudocolumn].dtype):\n                raise ValueError(f\"Column {pseudocolumn} has to contain integers only.\")\n    if api.TIME_PSEUDOCOLUMN in df.columns:\n        if any(df[api.TIME_PSEUDOCOLUMN] < 0):\n            raise ValueError(\n                f\"Column {api.TIME_PSEUDOCOLUMN} cannot contain negative times.\"\n            )\n        if any(df[api.TIME_PSEUDOCOLUMN] % 2 == 1):\n            warn(\n                \"timestamps are required to be even; all timestamps will be doubled\",\n                stacklevel=stacklevel + 1,\n            )\n            df[api.TIME_PSEUDOCOLUMN] = 2 * df[api.TIME_PSEUDOCOLUMN]\n\n    if api.DIFF_PSEUDOCOLUMN in df.columns:\n        if any((df[api.DIFF_PSEUDOCOLUMN] != 1) & (df[api.DIFF_PSEUDOCOLUMN] != -1)):\n            raise ValueError(\n                f\"Column {api.DIFF_PSEUDOCOLUMN} can only have 1 and -1 values.\"\n            )\n\n\n@check_arg_types\n@trace_user_frame\ndef table_from_rows(\n    schema: type[Schema],\n    rows: list[tuple],\n    unsafe_trusted_ids: bool = False,\n    is_stream=False,\n) -> Table:\n    \"\"\"A function for creating a table from a list of tuples. Each tuple should describe\n    one row of the input data (or stream), matching provided schema.\n\n    If ``is_stream`` is set to ``True``, each tuple representing a row should contain\n    two additional columns, the first indicating the time of arrival of particular row\n    and the second indicating whether the row should be inserted (1) or deleted (-1).","sourceCodeStart":302,"sourceCodeEnd":338,"githubUrl":"https://github.com/pathwaycom/pathway/blob/fa2f74a4649b7c5908690cf60137263d8d80de5f/python/pathway/debug/__init__.py#L302-L338","documentation":"Pathway connectors' persistent state is keyed by a unique name; 'persistent_id' is the deprecated spelling of 'name' and the _get_unique_name helper refuses calls that supply both, because the intended identifier would be ambiguous.","triggerScenarios":"Calling a Pathway IO connector (e.g. pw.io.csv.write, pw.io.kafka.read) with both name=... and persistent_id=... keyword arguments.","commonSituations":"Upgrading old Pathway code that used persistent_id while copy-pasting newer examples that use name; both end up in the same call and the API rejects the mix.","solutions":["Delete the persistent_id argument and keep only name.","Search the codebase for persistent_id and migrate every remaining occurrence to name to avoid the separate DeprecationWarning path."],"exampleFix":"# before\npw.io.csv.write(t, \"out.csv\", name=\"my-sink\", persistent_id=\"my-sink\")\n\n# after\npw.io.csv.write(t, \"out.csv\", name=\"my-sink\")","handlingStrategy":"validation","validationCode":"def unique_name(name: str | None, persistent_id: str | None) -> str | None:\n    if name is not None and persistent_id is not None:\n        raise ValueError(\"pass only 'name', not both\")\n    return name or persistent_id\n\npw.io.csv.write(t, \"out.csv\", name=unique_name(name, persistent_id))","typeGuard":null,"tryCatchPattern":null,"preventionTips":["After upgrading Pathway, grep for persistent_id and migrate all call sites to name.","Never carry both keys through config dicts; normalize to name at load time."],"tags":["pathway","deprecation","configuration","persistence"],"backgroundTag":null,"analyzedSha":"fa2f74a4649b7c5908690cf60137263d8d80de5f","analyzedAt":"2026-08-15T01:48:17.006Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}