pathwaycom/pathway · error · ValueError

The schema already declares a {METADATA_COLUMN_NAME!r} colum

Error message

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

What it means

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.

Source

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

            **api_schema,
            parse_utf8=parse_utf8,
            key_generation_policy=(
                api.KeyGenerationPolicy.ALWAYS_AUTOGENERATE
                if autogenerate_key
                else api.KeyGenerationPolicy.PREFER_MESSAGE_KEY
            ),
            schema_registry_settings=maybe_schema_registry_settings(
                schema_registry_settings
            ),
            message_queue_key_field=(
                MESSAGE_QUEUE_KEY_COLUMN_NAME if with_native_record_key else None
            ),
        )

    schema = assert_schema_not_none(schema, data_format_type)
    if METADATA_COLUMN_NAME in schema.column_names():
        if with_metadata:
            raise ValueError(
                f"The schema already declares a {METADATA_COLUMN_NAME!r} column, "
                f"which conflicts with 'with_metadata=True'. Either remove "
                f"{METADATA_COLUMN_NAME!r} from the schema or set "
                "'with_metadata=False'."
            )
        raise ValueError(
            f"{METADATA_COLUMN_NAME!r} is a reserved column name used by "
            "Pathway's connector metadata. Declaring it in the schema would "
            "be silently shadowed by the connector. Rename your column to "
            "something else, or set 'with_metadata=True' to receive the "
            "auto-generated metadata in this column."
        )
    if with_metadata:
        schema |= MetadataSchema

    schema, api_schema = read_schema(schema)
    if data_format_type == "dsv":
        if json_field_paths is not None:

View on GitHub (pinned to fa2f74a464)

Solutions

  1. Remove the '_metadata' column from your schema or call the reader with with_metadata=False.

Example fix

pw.io.csv.read(path, schema=MySchema, with_metadata=False)

When it happens

Trigger: Thrown at python/pathway/io/_utils.py:339 when the library encounters an invalid state.

Common situations: See trigger scenarios.


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