pathwaycom/pathway · error · ValueError
'delimiter' is only meaningful for the 'dsv' format, but {fo
Error message
'delimiter' is only meaningful for the 'dsv' format, but {format!r} was specified. Drop the 'delimiter' argument or use format='dsv'. What it means
Raised by MessageQueueOutputFormat.build when the output format is not 'dsv' but a non-default 'delimiter' was passed. Delimiter only controls field separation for CSV/DSV output; for 'json', 'raw', or 'plaintext' it has no effect, so passing one is treated as a likely mistake (note the default ',' is allowed).
Source
Thrown at python/pathway/io/_utils.py:453
@classmethod
def construct(
cls,
table: Table,
*,
format: str = "json",
delimiter: str = ",",
key: ColumnReference | None = None,
value: ColumnReference | None = None,
headers: Iterable[ColumnReference] | None = None,
topic_name: ColumnReference | None = None,
schema_registry_settings: SchemaRegistrySettings | None = None,
subject: str | None = None,
allowed_key_types: tuple[dt.DType, ...] | None = (dt.BYTES, dt.STR, dt.ANY),
allowed_value_types: tuple[dt.DType, ...] | None = (dt.BYTES, dt.STR, dt.ANY),
) -> MessageQueueOutputFormat:
if delimiter != "," and format != "dsv":
raise ValueError(
f"'delimiter' is only meaningful for the 'dsv' format, but "
f"{format!r} was specified. Drop the 'delimiter' argument "
f"or use format='dsv'."
)
if subject is not None and schema_registry_settings is None:
raise ValueError(
"'subject' was provided without 'schema_registry_settings'. "
"The 'subject' parameter only has an effect when a schema "
"registry is configured; either pass 'schema_registry_settings' "
"or remove 'subject'."
)
if schema_registry_settings is not None and subject is None:
raise ValueError(
"'schema_registry_settings' was provided without 'subject'. "
"When a schema registry is configured, 'subject' must also be "
"set so the formatter knows which subject to encode under."
)
if subject is not None and not subject:View on GitHub (pinned to fa2f74a464)
Solutions
- Drop the 'delimiter' argument when format is not 'dsv'.
- Or change format to 'dsv' if you actually intended delimited output.
Example fix
# before pw.io.kafka.write(t, ..., format='json', delimiter=';') # after pw.io.kafka.write(t, ..., format='json')
Defensive patterns
Strategy: validation
Validate before calling
if format != 'dsv':
assert delimiter == ',', "delimiter is only accepted for format='dsv'" Try / catch
try:
pw.io.kafka.write(t, ..., format=format, delimiter=delim)
except ValueError as e:
if "'delimiter' is only meaningful" in str(e):
pw.io.kafka.write(t, ..., format=format) # retry without delimiter
else:
raise Prevention
- Only set 'delimiter' in dsv-specific config branches.
- Treat non-default delimiter as a dsv-only option in your config schema.
When it happens
Trigger: pw.io.kafka.write(table, ..., format='json', delimiter=';'); switching an output from dsv to json while keeping the delimiter argument; reusing one kwargs dict across several writers.
Common situations: Shared config dicts reused for multiple sinks; refactoring a CSV output into JSON output without pruning format-specific options.
Related errors
- 'subject' was provided without 'schema_registry_settings'. T
- 'schema_registry_settings' was provided without 'subject'. W
- Unsupported format: {format}
- Failed to install dependencies
- Column {pseudocolumn} has to contain integers only.
AI-assisted analysis of pathwaycom/pathway@fa2f74a464 (2026-08-15).
Data as JSON: /api/errors/8a991b953990a83b.
Report an issue: GitHub.