pathwaycom/pathway · error · ValueError
Unsupported argument for {data_format!r} format: 'value'
Error message
Unsupported argument for {data_format!r} format: 'value' What it means
Raised by the @check_raw_and_plaintext_only_kwargs_for_message_queues decorator that wraps message-queue read connectors. When format is anything other than 'raw' or 'plaintext', the connector derives columns from parsed payloads, so passing the 'value' argument (which designates the payload column for raw/plaintext mode) is meaningless and almost certainly a configuration mistake; the decorator fails fast at call time.
Source
Thrown at python/pathway/io/_utils.py:418
format_type=data_format_type,
column_paths=json_field_paths,
schema_registry_settings=maybe_schema_registry_settings(
schema_registry_settings
),
)
else:
raise ValueError(f"data format `{format}` not supported")
def check_raw_and_plaintext_only_kwargs_for_message_queues(f):
default_format = inspect.signature(f).parameters["format"].default
@functools.wraps(f)
def wrapper(*args, **kwargs):
data_format = kwargs.get("format", default_format)
if data_format not in ("raw", "plaintext"):
if "value" in kwargs and kwargs["value"] is not None:
raise ValueError(
f"Unsupported argument for {data_format!r} format: 'value'"
)
return f(*args, **kwargs)
return wrapper
@dataclass(frozen=True)
class MessageQueueOutputFormat:
_: KW_ONLY
table: Table
key_field_index: int | None
header_fields: dict[str, int]
data_format: api.DataFormat
topic_name_index: int | None
@classmethodView on GitHub (pinned to fa2f74a464)
Solutions
- Remove the 'value' argument when using a parsed format such as 'json' or 'dsv'.
- If you really wanted raw payload access, switch format to 'raw' or 'plaintext' and keep value=.
- If you need one column extracted from parsed JSON, use json_field_paths instead of value=.
Example fix
# before t = pw.io.kafka.read(..., format='json', value=pw.this.payload) # after t = pw.io.kafka.read(..., format='json')
Defensive patterns
Strategy: validation
Validate before calling
kwargs = dict(...)
if kwargs.get('format', 'raw') not in ('raw', 'plaintext'):
kwargs.pop('value', None)
t = pw.io.kafka.read(**kwargs) Try / catch
try:
t = pw.io.kafka.read(..., format=fmt, value=val)
except ValueError as e:
if "Unsupported argument" in str(e) and "'value'" in str(e):
val = None # retry without value for parsed formats
t = pw.io.kafka.read(..., format=fmt)
else:
raise Prevention
- Build connector kwargs per format family; never share one dict between raw and structured configs.
- When switching format from 'raw' to 'json', delete value= and key=-payload related args.
When it happens
Trigger: Calling pw.io.kafka.read(..., format='json', value=pw.this.payload); switching a connector config from format='raw' to format='json' (or 'dsv') while leaving the old value= argument in place.
Common situations: Iterating on a connector config: start with raw payloads plus a value column, then switch to a parsed format and forget to delete value=; copy-pasting arguments between raw and structured examples.
Related errors
- 'schema_registry_settings' is only meaningful for the 'json'
- 'value' and format='{format}' cannot be set at the same time
- Unsupported format: {format}
- The sort_by column {column.name!r} is not part of the data b
- Failed to install dependencies
AI-assisted analysis of pathwaycom/pathway@fa2f74a464 (2026-08-15).
Data as JSON: /api/errors/52420c0b00dab510.
Report an issue: GitHub.