pathwaycom/pathway · error · ValueError

Unsupported format: {format}

Error message

Unsupported format: {format}

What it means

Raised by MessageQueueOutputFormat.build when 'format' is none of 'json', 'dsv', 'raw', or 'plaintext' — the only output formats this message-queue writer supports. It is the final else-branch after all format-specific branches, catching typos and unsupported names before any data flows.

Source

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

                allowed_value_types is not None
                and table[value._name]._column.dtype not in allowed_value_types
            ):
                raise ValueError(
                    f"The value column must have one of the following types: {allowed_value_types}"
                )

            data_format = api.DataFormat(
                format_type="single_column",
                key_field_names=[],
                value_fields=_format_output_value_fields(table),
                value_field_index=value_field_index,
                schema_registry_settings=maybe_schema_registry_settings(
                    schema_registry_settings
                ),
                subject=subject,
            )
        else:
            raise ValueError(f"Unsupported format: {format}")

        return cls(
            table=table,
            key_field_index=key_field_index,
            header_fields=header_fields,
            data_format=data_format,
            topic_name_index=topic_name_index,
        )

    @staticmethod
    def add_column_reference_to_extract(
        column_reference: ColumnReference,
        selection_list: list[ColumnReference],
        field_indices: dict[str, int],
    ) -> int:
        column_name = column_reference.name

        index_in_new_table = field_indices.get(column_name)

View on GitHub (pinned to fa2f74a464)

Solutions

  1. Use one of: 'json', 'dsv', 'raw', 'plaintext' (note: delimited output is 'dsv', not 'csv').
  2. If you need Avro or another format, serialize the payload yourself into a bytes column and write it with format='raw'.

Example fix

# before
pw.io.kafka.write(t, ..., format='csv')

# after
pw.io.kafka.write(t, ..., format='dsv', delimiter=',')
Defensive patterns

Strategy: validation

Validate before calling

SUPPORTED_OUTPUT_FORMATS = {'json', 'dsv', 'raw', 'plaintext'}
assert fmt in SUPPORTED_OUTPUT_FORMATS, f"unsupported output format {fmt!r}; use one of {sorted(SUPPORTED_OUTPUT_FORMATS)}"

Type guard

def is_supported_output_format(fmt: str) -> bool:
    return fmt in {'json', 'dsv', 'raw', 'plaintext'}

Try / catch

try:
    pw.io.kafka.write(t, ..., format=fmt)
except ValueError as e:
    if 'Unsupported format' in str(e):
        raise SystemExit(f"Use json/dsv/raw/plaintext for output; got {fmt!r}")
    raise

Prevention

When it happens

Trigger: pw.io.kafka.write(t, ..., format='csv') (must be 'dsv'), format='avro', or a case typo like 'Json'; passing an input-format name where an output-format name is expected.

Common situations: Confusion between read-side format names (e.g. 'csv') and write-side names ('dsv'); expecting Avro output because the read side has schema-registry support; copy-paste between read and write calls.

Related errors


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