{"record":{"id":"64e4127f48466e72","repo":"pathwaycom/pathway","slug":"simple-read-does-not-accept-forbidden-r-if-yo","errorCode":null,"errorMessage":"'simple_read' does not accept {forbidden!r}. If you need to customize the rdkafka settings (auth, TLS, consumer group, etc.) use 'pw.io.kafka.read' directly; 'simple_read' is a thin wrapper that builds these settings itself.","messagePattern":"'simple_read' does not accept (.+?)\\. If you need to customize the rdkafka settings \\(auth, TLS, consumer group, etc\\.\\) use 'pw\\.io\\.kafka\\.read' directly; 'simple_read' is a thin wrapper that builds these settings itself\\.","errorType":"validation","errorClass":"TypeError","httpStatus":null,"severity":"error","filePath":"python/pathway/io/kafka/__init__.py","lineNumber":493,"sourceCode":"    table: the message key is saved in a column named ``key`` and the message payload\n    in a column named ``data``.\n\n    For the \"json\" format, a ``schema`` is required and its columns define the table.\n\n    Example:\n\n    Consider that there's a Kafka queue running locally on the port 9092 and we need\n    to read raw messages from the topic \"test-topic\". Then, it can be done in the\n    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 \"","sourceCodeStart":475,"sourceCodeEnd":511,"githubUrl":"https://github.com/pathwaycom/pathway/blob/fa2f74a4649b7c5908690cf60137263d8d80de5f/python/pathway/io/kafka/__init__.py#L475-L511","documentation":"pw.io.kafka.simple_read is a thin convenience wrapper that builds the rdkafka settings itself from a server address and random group id. It therefore rejects the 'rdkafka_settings' (and internal '_stacklevel') keyword: passing it would silently override the wrapper's own settings construction.","triggerScenarios":"pw.io.kafka.simple_read('localhost:9092', 'test-topic', rdkafka_settings={...}) or forwarding a **kwargs dict that contains rdkafka_settings into simple_read.","commonSituations":"Starting from a simple_read example and then trying to add SASL/TLS/group-id configuration by passing rdkafka_settings; writing a generic wrapper that forwards the same options to both read and simple_read.","solutions":["If you need custom settings (auth, TLS, consumer group, offset reset), switch to pw.io.kafka.read with a full rdkafka_settings dict.","Otherwise drop the rdkafka_settings argument and let simple_read configure itself."],"exampleFix":"# before\nrdkafka_settings = {\"bootstrap.servers\": \"localhost:9092\", \"group.id\": \"g\", \"sasl.mechanisms\": \"PLAIN\"}\nt = pw.io.kafka.simple_read(rdkafka_settings=rdkafka_settings, topic=\"t\")\n# after\nt = pw.io.kafka.read(rdkafka_settings, topic=\"t\")","handlingStrategy":"type-guard","validationCode":"SIMPLE_READ_FORBIDDEN = {\"rdkafka_settings\", \"_stacklevel\"}\nbad = SIMPLE_READ_FORBIDDEN & set(kwargs)\nif bad:\n    raise SystemExit(f\"simple_read cannot take {bad}; use pw.io.kafka.read\")\n\nt = pw.io.kafka.simple_read(\"localhost:9092\", \"test-topic\", **kwargs)","typeGuard":"def simple_read_safe(kwargs: dict) -> bool:\n    return not ({\"rdkafka_settings\", \"_stacklevel\"} & set(kwargs))","tryCatchPattern":null,"preventionTips":["Treat simple_read as demo/quick-start only; move to read() the moment you need auth or TLS.","Do not forward a shared kwargs dict into simple_read."],"tags":["kafka","api-misuse","configuration","pathway"],"backgroundTag":null,"analyzedSha":"fa2f74a4649b7c5908690cf60137263d8d80de5f","analyzedAt":"2026-08-15T01:48:17.006Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}