{"record":{"id":"2a5fa19352fcaff6","repo":"pathwaycom/pathway","slug":"read-only-new-true-and-start-from-timestamp-ms","errorCode":null,"errorMessage":"'read_only_new=True' and 'start_from_timestamp_ms' both control the starting position and conflict. Pick one — drop 'read_only_new=True' if you want to start from the timestamp, or drop 'start_from_timestamp_ms' if you want to start from the end.","messagePattern":"'read_only_new=True' and 'start_from_timestamp_ms' both control the starting position and conflict\\. Pick one — drop 'read_only_new=True' if you want to start from the timestamp, or drop 'start_from_timestamp_ms' if you want to start from the end\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/pathway/io/kafka/__init__.py","lineNumber":510,"sourceCode":"        if forbidden in kwargs:\n            raise TypeError(\n                f\"'simple_read' does not accept {forbidden!r}. \"\n                \"If you need to customize the rdkafka settings (auth, TLS, \"\n                \"consumer group, etc.) use 'pw.io.kafka.read' directly; \"\n                \"'simple_read' is a thin wrapper that builds these settings \"\n                \"itself.\"\n            )\n\n    if read_only_new and kwargs.get(\"mode\") == \"static\":\n        raise ValueError(\n            \"'read_only_new=True' together with mode='static' is \"\n            \"self-contradictory: 'read_only_new' starts the consumer at the \"\n            \"end of the partition, so the static reader has nothing to \"\n            \"consume. Pick one — drop 'read_only_new=True' or use \"\n            \"'mode=\\\"streaming\\\"' (the default).\"\n        )\n    if read_only_new and kwargs.get(\"start_from_timestamp_ms\") is not None:\n        raise ValueError(\n            \"'read_only_new=True' and 'start_from_timestamp_ms' both control \"\n            \"the starting position and conflict. Pick one — drop \"\n            \"'read_only_new=True' if you want to start from the timestamp, \"\n            \"or drop 'start_from_timestamp_ms' if you want to start from \"\n            \"the end.\"\n        )\n\n    rdkafka_settings = {\n        \"bootstrap.servers\": server,\n        \"group.id\": str(uuid.uuid4()),\n        \"auto.offset.reset\": \"end\" if read_only_new else \"beginning\",\n    }\n    return read(\n        rdkafka_settings=rdkafka_settings,\n        topic=topic,\n        schema=schema,\n        format=format,\n        debug_data=debug_data,","sourceCodeStart":492,"sourceCodeEnd":528,"githubUrl":"https://github.com/pathwaycom/pathway/blob/fa2f74a4649b7c5908690cf60137263d8d80de5f/python/pathway/io/kafka/__init__.py#L492-L528","documentation":"In pw.io.kafka.simple_read, read_only_new=True (seek to end) and start_from_timestamp_ms (seek to a time offset) are two different ways of choosing the consumer's starting position and cannot both apply. Pathway raises ValueError asking you to pick one.","triggerScenarios":"pw.io.kafka.simple_read('localhost:9092', 'test-topic', read_only_new=True, start_from_timestamp_ms=1700000000000). Internally simple_read sets auto.offset.reset to 'end' when read_only_new is set, which would conflict with the timestamp seek.","commonSituations":"Stacking 'start from now-ish' flags while tuning startup behavior; forwarding both options from a shared config dict into simple_read.","solutions":["Keep start_from_timestamp_ms and drop read_only_new if you want to start at a specific time.","Keep read_only_new=True and drop start_from_timestamp_ms if you want the very end of the partition.","For full control (both concerns, custom offsets), use pw.io.kafka.read with explicit rdkafka_settings."],"exampleFix":"# before\nt = pw.io.kafka.simple_read(\n    \"localhost:9092\", \"test-topic\",\n    read_only_new=True, start_from_timestamp_ms=1700000000000,\n)\n# after\nt = pw.io.kafka.simple_read(\n    \"localhost:9092\", \"test-topic\",\n    start_from_timestamp_ms=1700000000000,\n)","handlingStrategy":"validation","validationCode":"if read_only_new and start_from_timestamp_ms is not None:\n    raise SystemExit(\n        \"Pick one starting position: read_only_new=True OR start_from_timestamp_ms\"\n    )\n\nt = pw.io.kafka.simple_read(\n    \"localhost:9092\", \"test-topic\",\n    read_only_new=read_only_new,\n    start_from_timestamp_ms=start_from_timestamp_ms,\n)","typeGuard":"def compatible_start_opts(read_only_new: bool, ts) -> bool:\n    return not (read_only_new and ts is not None)","tryCatchPattern":null,"preventionTips":["Model 'start position' as a single config field (none|end|timestamp) instead of independent booleans.","Validate the combined option set once at startup."],"tags":["kafka","api-misuse","offsets","pathway"],"backgroundTag":null,"analyzedSha":"fa2f74a4649b7c5908690cf60137263d8d80de5f","analyzedAt":"2026-08-15T01:48:17.006Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}