{"record":{"id":"e44e548af783fbbb","repo":"pathwaycom/pathway","slug":"unsupported-format-format","errorCode":null,"errorMessage":"Unsupported format: {format}","messagePattern":"Unsupported format: (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/pathway/io/_utils.py","lineNumber":608,"sourceCode":"                allowed_value_types is not None\n                and table[value._name]._column.dtype not in allowed_value_types\n            ):\n                raise ValueError(\n                    f\"The value column must have one of the following types: {allowed_value_types}\"\n                )\n\n            data_format = api.DataFormat(\n                format_type=\"single_column\",\n                key_field_names=[],\n                value_fields=_format_output_value_fields(table),\n                value_field_index=value_field_index,\n                schema_registry_settings=maybe_schema_registry_settings(\n                    schema_registry_settings\n                ),\n                subject=subject,\n            )\n        else:\n            raise ValueError(f\"Unsupported format: {format}\")\n\n        return cls(\n            table=table,\n            key_field_index=key_field_index,\n            header_fields=header_fields,\n            data_format=data_format,\n            topic_name_index=topic_name_index,\n        )\n\n    @staticmethod\n    def add_column_reference_to_extract(\n        column_reference: ColumnReference,\n        selection_list: list[ColumnReference],\n        field_indices: dict[str, int],\n    ) -> int:\n        column_name = column_reference.name\n\n        index_in_new_table = field_indices.get(column_name)","sourceCodeStart":590,"sourceCodeEnd":626,"githubUrl":"https://github.com/pathwaycom/pathway/blob/fa2f74a4649b7c5908690cf60137263d8d80de5f/python/pathway/io/_utils.py#L590-L626","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Use one of: 'json', 'dsv', 'raw', 'plaintext' (note: delimited output is 'dsv', not 'csv').","If you need Avro or another format, serialize the payload yourself into a bytes column and write it with format='raw'."],"exampleFix":"# before\npw.io.kafka.write(t, ..., format='csv')\n\n# after\npw.io.kafka.write(t, ..., format='dsv', delimiter=',')","handlingStrategy":"validation","validationCode":"SUPPORTED_OUTPUT_FORMATS = {'json', 'dsv', 'raw', 'plaintext'}\nassert fmt in SUPPORTED_OUTPUT_FORMATS, f\"unsupported output format {fmt!r}; use one of {sorted(SUPPORTED_OUTPUT_FORMATS)}\"","typeGuard":"def is_supported_output_format(fmt: str) -> bool:\n    return fmt in {'json', 'dsv', 'raw', 'plaintext'}","tryCatchPattern":"try:\n    pw.io.kafka.write(t, ..., format=fmt)\nexcept ValueError as e:\n    if 'Unsupported format' in str(e):\n        raise SystemExit(f\"Use json/dsv/raw/plaintext for output; got {fmt!r}\")\n    raise","preventionTips":["Remember write-side names differ from read-side: 'dsv' not 'csv', no 'avro'.","Validate format strings against a constant set before building sinks."],"tags":["pathway","kafka","output","format","validation"],"backgroundTag":null,"analyzedSha":"fa2f74a4649b7c5908690cf60137263d8d80de5f","analyzedAt":"2026-08-15T01:48:17.006Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}