pathwaycom/pathway · error · ValueError

'subject' was provided without 'schema_registry_settings'. T

Error message

'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'.

What it means

Raised by MessageQueueOutputFormat.build when a Schema Registry 'subject' is given without 'schema_registry_settings'. The subject names which schema version to encode under, and it only has an effect when a registry is actually configured; without registry settings it would be silently ignored, so Pathway rejects the combination up front.

Source

Thrown at python/pathway/io/_utils.py:459

        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:
            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":

View on GitHub (pinned to fa2f74a464)

Solutions

  1. Pass schema_registry_settings=pw.io.kafka.SchemaRegistrySettings(url=...) together with subject.
  2. Or remove 'subject' if you do not intend to use a schema registry.

Example fix

# before
pw.io.kafka.write(t, ..., subject='orders-value')

# after
pw.io.kafka.write(t, ...,
    schema_registry_settings=pw.io.kafka.SchemaRegistrySettings(url='http://localhost:8081'),
    subject='orders-value')
Defensive patterns

Strategy: validation

Validate before calling

if subject is not None:
    assert schema_registry_settings is not None, "subject requires schema_registry_settings"

Try / catch

try:
    pw.io.kafka.write(t, ..., subject=subject)
except ValueError as e:
    if "without 'schema_registry_settings'" in str(e):
        pw.io.kafka.write(t, ...,
            schema_registry_settings=pw.io.kafka.SchemaRegistrySettings(url=REGISTRY_URL),
            subject=subject)
    else:
        raise

Prevention

When it happens

Trigger: pw.io.kafka.write(table, ..., subject='my-topic-value') with no schema_registry_settings; removing registry settings during a local test run while forgetting the subject argument.

Common situations: Testing locally without a Confluent Schema Registry but leaving production's subject parameter in the call; incremental adoption of schema-registry support where settings were never wired up.

Related errors


AI-assisted analysis of pathwaycom/pathway@fa2f74a464 (2026-08-15). Data as JSON: /api/errors/75b218a0191f82e4. Report an issue: GitHub.