{"record":{"id":"100b35d943079a66","repo":"pathwaycom/pathway","slug":"the-schema-already-declares-a-metadata-column-nam","errorCode":null,"errorMessage":"The schema already declares a {METADATA_COLUMN_NAME!r} column, which conflicts with 'with_metadata=True'. Either remove {METADATA_COLUMN_NAME!r} from the schema or set 'with_metadata=False'.","messagePattern":"The schema already declares a (.+?) column, which conflicts with 'with_metadata=True'\\. Either remove (.+?) from the schema or set 'with_metadata=False'\\.","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/pathway/io/_utils.py","lineNumber":339,"sourceCode":"            **api_schema,\n            parse_utf8=parse_utf8,\n            key_generation_policy=(\n                api.KeyGenerationPolicy.ALWAYS_AUTOGENERATE\n                if autogenerate_key\n                else api.KeyGenerationPolicy.PREFER_MESSAGE_KEY\n            ),\n            schema_registry_settings=maybe_schema_registry_settings(\n                schema_registry_settings\n            ),\n            message_queue_key_field=(\n                MESSAGE_QUEUE_KEY_COLUMN_NAME if with_native_record_key else None\n            ),\n        )\n\n    schema = assert_schema_not_none(schema, data_format_type)\n    if METADATA_COLUMN_NAME in schema.column_names():\n        if with_metadata:\n            raise ValueError(\n                f\"The schema already declares a {METADATA_COLUMN_NAME!r} column, \"\n                f\"which conflicts with 'with_metadata=True'. Either remove \"\n                f\"{METADATA_COLUMN_NAME!r} from the schema or set \"\n                \"'with_metadata=False'.\"\n            )\n        raise ValueError(\n            f\"{METADATA_COLUMN_NAME!r} is a reserved column name used by \"\n            \"Pathway's connector metadata. Declaring it in the schema would \"\n            \"be silently shadowed by the connector. Rename your column to \"\n            \"something else, or set 'with_metadata=True' to receive the \"\n            \"auto-generated metadata in this column.\"\n        )\n    if with_metadata:\n        schema |= MetadataSchema\n\n    schema, api_schema = read_schema(schema)\n    if data_format_type == \"dsv\":\n        if json_field_paths is not None:","sourceCodeStart":321,"sourceCodeEnd":357,"githubUrl":"https://github.com/pathwaycom/pathway/blob/fa2f74a4649b7c5908690cf60137263d8d80de5f/python/pathway/io/_utils.py#L321-L357","documentation":"Error \"The schema already declares a {METADATA_COLUMN_NAME!r} column, which conflicts with 'with_metadata=True'. Either remove {METADATA_COLUMN_NAME!r} from the schema or set 'with_metadata=False'.\" thrown in pathwaycom/pathway.","triggerScenarios":"Thrown at python/pathway/io/_utils.py:339 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Remove the '_metadata' column from your schema or call the reader with with_metadata=False."],"exampleFix":"pw.io.csv.read(path, schema=MySchema, with_metadata=False)","handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"fa2f74a4649b7c5908690cf60137263d8d80de5f","analyzedAt":"2026-08-15T01:48:17.006Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}