pathwaycom/pathway · error · ValueError
'schema_registry_settings' is only meaningful for the 'json'
Error message
'schema_registry_settings' is only meaningful for the 'json' format, but {format!r} was specified. The Confluent Schema Registry currently encodes JSON payloads only; remove 'schema_registry_settings' or use format='json'. What it means
Raised by MessageQueueOutputFormat.build when schema_registry_settings is combined with a format other than 'json'. The Confluent Schema Registry integration in this connector only encodes JSON payloads (JSON Schema), so registry settings with 'dsv', 'raw', or 'plaintext' would be silently unused; Pathway raises instead.
Source
Thrown at python/pathway/io/_utils.py:478
"'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:
raise ValueError(
"'subject' must be a non-empty string; got an empty string. "
"Schema Registry subjects identify a named schema version, "
"and an empty subject is never a valid registry entry."
)
if schema_registry_settings is not None and format != "json":
raise ValueError(
f"'schema_registry_settings' is only meaningful for the 'json' "
f"format, but {format!r} was specified. The Confluent Schema "
"Registry currently encodes JSON payloads only; remove "
"'schema_registry_settings' or use format='json'."
)
key_field_index = None
header_fields: dict[str, int] = {}
extracted_field_indices: dict[str, int] = {}
columns_to_extract: list[ColumnReference] = []
if topic_name is not None:
topic_name_index = cls.add_column_reference_to_extract(
topic_name, columns_to_extract, extracted_field_indices
)
if topic_name._column.dtype not in (dt.STR, dt.ANY):
raise ValueError(
"The topic name column must have a string type, however "View on GitHub (pinned to fa2f74a464)
Solutions
- Use format='json' if you need Schema Registry encoding.
- Or remove schema_registry_settings (and subject) when writing dsv/raw/plaintext.
Example fix
# before
pw.io.kafka.write(t, ..., format='raw',
schema_registry_settings=settings, subject='s')
# after
pw.io.kafka.write(t, ..., format='json',
schema_registry_settings=settings, subject='s') Defensive patterns
Strategy: validation
Validate before calling
if schema_registry_settings is not None:
assert format == 'json', "Schema Registry output encoding requires format='json'" Try / catch
try:
pw.io.kafka.write(t, ..., format=format, schema_registry_settings=settings, subject=s)
except ValueError as e:
if "only meaningful for the 'json' format" in str(e):
pw.io.kafka.write(t, ..., format=format) # registry not applicable; drop it
else:
raise Prevention
- Gate schema-registry options behind format=='json' in your sink factory.
- Do not assume Avro output; this writer's registry support is JSON-only.
When it happens
Trigger: pw.io.kafka.write(table, ..., format='dsv', schema_registry_settings=settings, subject=...); switching an output format from json to raw while keeping registry settings; assuming Avro registry support (format='avro' style usage) that this writer does not have.
Common situations: Teams expecting Avro-style schema-registry encoding; refactoring output format while leaving registry options in the call.
Related errors
- Unsupported argument for {data_format!r} format: 'value'
- 'subject' was provided without 'schema_registry_settings'. T
- 'schema_registry_settings' was provided without 'subject'. W
- 'subject' must be a non-empty string; got an empty string. S
- 'value' and format='{format}' cannot be set at the same time
AI-assisted analysis of pathwaycom/pathway@fa2f74a464 (2026-08-15).
Data as JSON: /api/errors/4cdfef63f9bce14a.
Report an issue: GitHub.