{"record":{"id":"a38f6d2970340f37","repo":"pathwaycom/pathway","slug":"read-only-new-true-together-with-mode-static-i","errorCode":null,"errorMessage":"'read_only_new=True' together with mode='static' is self-contradictory: 'read_only_new' starts the consumer at the end of the partition, so the static reader has nothing to consume. Pick one — drop 'read_only_new=True' or use 'mode=\"streaming\"' (the default).","messagePattern":"'read_only_new=True' together with mode='static' is self-contradictory: 'read_only_new' starts the consumer at the end of the partition, so the static reader has nothing to consume\\. Pick one — drop 'read_only_new=True' or use 'mode=\"streaming\"' \\(the default\\)\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/pathway/io/kafka/__init__.py","lineNumber":502,"sourceCode":"    following way:\n\n    >>> import pathway as pw\n    >>> t = pw.io.kafka.simple_read(\"localhost:9092\", \"test-topic\")\n    \"\"\"\n\n    forbidden_kwargs = (\"rdkafka_settings\", \"_stacklevel\")\n    for forbidden in forbidden_kwargs:\n        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()),","sourceCodeStart":484,"sourceCodeEnd":520,"githubUrl":"https://github.com/pathwaycom/pathway/blob/fa2f74a4649b7c5908690cf60137263d8d80de5f/python/pathway/io/kafka/__init__.py#L484-L520","documentation":"In pw.io.kafka.simple_read, read_only_new=True sets auto.offset.reset='end' so the consumer starts at the newest messages, while mode='static' reads only what exists at snapshot time. The combination would find nothing to consume, so Pathway rejects it as self-contradictory with an explicit ValueError.","triggerScenarios":"pw.io.kafka.simple_read('localhost:9092', 'test-topic', read_only_new=True, mode='static'). The default mode is 'streaming', where read_only_new is valid.","commonSituations":"Adding read_only_new=True to an existing static-mode pipeline expecting 'only new data going forward'; copy-pasting flags between examples without reconciling mode semantics.","solutions":["Drop read_only_new=True if you want a static snapshot-style read from the beginning.","Or switch to mode='streaming' (the default) if you want to process only newly arriving messages.","Remember static mode implies a bounded read; streaming mode with read_only_new gives a live tail of the topic."],"exampleFix":"# before\nt = pw.io.kafka.simple_read(\"localhost:9092\", \"test-topic\", read_only_new=True, mode=\"static\")\n# after\nt = pw.io.kafka.simple_read(\"localhost:9092\", \"test-topic\", read_only_new=True)  # mode=\"streaming\" default","handlingStrategy":"validation","validationCode":"if read_only_new and mode == \"static\":\n    raise SystemExit(\n        \"read_only_new=True needs streaming mode; drop it or use mode='streaming'\"\n    )\n\nt = pw.io.kafka.simple_read(\"localhost:9092\", \"test-topic\", read_only_new=read_only_new, mode=mode)","typeGuard":"def compatible_simple_read_opts(read_only_new: bool, mode: str) -> bool:\n    return not (read_only_new and mode == \"static\")","tryCatchPattern":null,"preventionTips":["Keep mode explicit in config files so flag conflicts are visible.","Remember read_only_new maps to auto.offset.reset='end' — meaningless for bounded static reads."],"tags":["kafka","api-misuse","mode-conflict","pathway"],"backgroundTag":null,"analyzedSha":"fa2f74a4649b7c5908690cf60137263d8d80de5f","analyzedAt":"2026-08-15T01:48:17.006Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}