{"record":{"id":"8f99bc8a145c91c1","repo":"pathwaycom/pathway","slug":"column-api-time-pseudocolumn-cannot-contain-nega","errorCode":null,"errorMessage":"Column {api.TIME_PSEUDOCOLUMN} cannot contain negative times.","messagePattern":"Column (.+?) cannot contain negative times\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/pathway/debug/__init__.py","lineNumber":308,"sourceCode":"        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\n\n@check_arg_types\n@trace_user_frame","sourceCodeStart":290,"sourceCodeEnd":326,"githubUrl":"https://github.com/pathwaycom/pathway/blob/fa2f74a4649b7c5908690cf60137263d8d80de5f/python/pathway/debug/__init__.py#L290-L326","documentation":"The start_from_timestamp_ms parameter is only meaningful when start_from=\"timestamp\". The shared validation helper rejects any other combination so that the encoded value passed to the engine is unambiguous.","triggerScenarios":"Calling a Pathway IO read API with start_from set to anything other than \"timestamp\" (e.g. \"start\" or \"end\") while still passing a non-None start_from_timestamp_ms.","commonSituations":"User changes start_from from \"timestamp\" to \"end\" but leaves the old timestamp argument in place; or a config template supplies both keys and only one is updated when switching modes.","solutions":["Remove start_from_timestamp_ms from the call when start_from is not \"timestamp\".","If you meant to start from a specific time, set start_from=\"timestamp\" and keep the timestamp argument."],"exampleFix":"# before\npw.io.kafka.read(..., start_from=\"end\", start_from_timestamp_ms=1700000000000)\n\n# after\npw.io.kafka.read(..., start_from=\"end\")","handlingStrategy":"validation","validationCode":"def encode_start_from(start_from: str, ts: int | None) -> dict:\n    if start_from == \"timestamp\":\n        return {\"start_from\": \"timestamp\", \"start_from_timestamp_ms\": ts}\n    assert ts is None, \"start_from_timestamp_ms only valid with start_from='timestamp'\"\n    return {\"start_from\": start_from}\n\npw.io.kafka.read(..., **encode_start_from(start_from, ts))","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Build connector kwargs programmatically so the timestamp key is only present in timestamp mode.","Lint config files for leftover start_from_timestamp_ms keys after switching start_from."],"tags":["pathway","kafka","configuration","validation"],"backgroundTag":null,"analyzedSha":"fa2f74a4649b7c5908690cf60137263d8d80de5f","analyzedAt":"2026-08-15T01:48:17.006Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}