{"record":{"id":"dddb656a3e4ce6ae","repo":"pathwaycom/pathway","slug":"column-pseudocolumn-has-to-contain-integers-only","errorCode":null,"errorMessage":"Column {pseudocolumn} has to contain integers only.","messagePattern":"Column (.+?) has to contain integers only\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/pathway/debug/__init__.py","lineNumber":305,"sourceCode":"    series_dict = {}\n    for name in columns:\n        dtype = _dtype_to_pandas(table.schema.typehints()[name])\n        if include_id:\n            series = pd.Series(columns[name], dtype=dtype)\n        else:\n            # we need to remove original keys, otherwise pandas will use them to create index\n            series = pd.Series(list(columns[name].values()), dtype=dtype)\n        series_dict[name] = series\n    index = keys if include_id else None\n    res = pd.DataFrame(series_dict, index=index)\n    return res\n\n\ndef _validate_dataframe(df: pd.DataFrame, stacklevel: int = 1) -> None:\n    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","sourceCodeStart":287,"sourceCodeEnd":323,"githubUrl":"https://github.com/pathwaycom/pathway/blob/fa2f74a4649b7c5908690cf60137263d8d80de5f/python/pathway/debug/__init__.py#L287-L323","documentation":"Pathway encodes start_from=\"end\" as the sentinel -1 in the start_from_timestamp_ms field, so user-supplied timestamps must be non-negative; a negative value would silently be interpreted as 'start from the end of the stream'. The validator rejects any timestamp < 0 to preserve that sentinel contract.","triggerScenarios":"Calling a Pathway IO read API with start_from=\"timestamp\" and a negative start_from_timestamp_ms, e.g. start_from_timestamp_ms=-1 or any value below zero.","commonSituations":"Developer uses -1 (or 0 minus something) as a 'replay everything' flag, mimicking other systems; or computes a timestamp from a negative date arithmetic result (e.g. subtraction overflow producing a negative ms value).","solutions":["Use a non-negative epoch-milliseconds value, e.g. start_from_timestamp_ms=0 to start from the very beginning of the retained stream.","If the intent was 'latest', use start_from=\"end\" and remove the timestamp argument.","Check how the timestamp is computed (e.g. datetime deltas) and fix the sign/units before passing it in."],"exampleFix":"# before\npw.io.kafka.read(..., start_from=\"timestamp\", start_from_timestamp_ms=-1)\n\n# after\npw.io.kafka.read(..., start_from=\"timestamp\", start_from_timestamp_ms=0)","handlingStrategy":"validation","validationCode":"from datetime import datetime, timezone\n\nts_ms = int(start_dt.timestamp() * 1000)\nassert ts_ms >= 0, f\"timestamp must be >= 0, got {ts_ms}\"\npw.io.kafka.read(..., start_from=\"timestamp\", start_from_timestamp_ms=ts_ms)","typeGuard":"def is_valid_timestamp_ms(ts: int | None) -> bool:\n    return ts is not None and ts >= 0","tryCatchPattern":null,"preventionTips":["Always derive timestamps from datetime/now arithmetic rather than hand-typed sentinel numbers.","Remember -1 is reserved internally by Pathway for start_from='end'; never use negative sentinels."],"tags":["pathway","kafka","validation","epoch","streaming"],"backgroundTag":null,"analyzedSha":"fa2f74a4649b7c5908690cf60137263d8d80de5f","analyzedAt":"2026-08-15T01:48:17.006Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}