{"record":{"id":"5cab4f8f679a1447","repo":"pathwaycom/pathway","slug":"ambiguous-property-schema-property-property-nam","errorCode":null,"errorMessage":"ambiguous property; schema property `{property_name}` has value {schema_property!r} but column `{column_name}` got {column_property!r}","messagePattern":"ambiguous property; schema property `(.+?)` has value (.+?) but column `(.+?)` got (.+?)","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/pathway/internals/schema.py","lineNumber":236,"sourceCode":"                f\"type annotation of column `{column_name}` does not match column definition\"\n            )\n\n        column_name = column.name or column_name\n\n        def _get_column_property(property_name: str, default: Any) -> Any:\n            match (\n                getattr(column, property_name),\n                getattr(schema_properties, property_name),\n            ):\n                case (None, None):\n                    return default\n                case (None, schema_property):\n                    return schema_property\n                case (column_property, None):\n                    return column_property\n                case (column_property, schema_property):\n                    if column_property != schema_property:\n                        raise ValueError(\n                            f\"ambiguous property; schema property `{property_name}` has\"\n                            + f\" value {schema_property!r} but column\"\n                            + f\" `{column_name}` got {column_property!r}\"\n                        )\n                    return column_property\n\n        columns[column_name] = ColumnSchema(\n            primary_key=column.primary_key,\n            default_value=column.default_value,\n            dtype=dt.wrap(dtype),\n            name=column_name,\n            append_only=_get_column_property(\"append_only\", False),\n            description=column.description,\n            example=column.example,\n            source_component=column.source_component,\n        )\n\n    if fields:","sourceCodeStart":218,"sourceCodeEnd":254,"githubUrl":"https://github.com/pathwaycom/pathway/blob/fa2f74a4649b7c5908690cf60137263d8d80de5f/python/pathway/internals/schema.py#L218-L254","documentation":"Column properties (e.g. append_only) can be set at schema level via schema_builder(properties=...) and per column via column_definition(...). When both are provided for the same property and their values differ, the property resolution in _get_column_property treats it as ambiguous and raises ValueError rather than silently picking one.","triggerScenarios":"pw.schema_builder(columns={...}, properties=SchemaProperties(append_only=True)) while a column in that schema declares column_definition(append_only=False), or vice versa with any conflicting property value.","commonSituations":"Setting a global schema property then overriding one column with a different value; composing schemas via | where one side carries conflicting properties.","solutions":["Remove the conflict: set the property either at schema level or on the column, not both with different values.","If a column genuinely needs a different value than the schema default, make all other columns consistent or omit the schema-level property.","Equal values on both levels are fine — only differing values raise; align them."],"exampleFix":"# before\ncols = {\"v\": pw.column_definition(dtype=int, append_only=False)}\nS = pw.schema_builder(columns=cols, properties=pw.SchemaProperties(append_only=True))\n\n# after\ncols = {\"v\": pw.column_definition(dtype=int)}\nS = pw.schema_builder(columns=cols, properties=pw.SchemaProperties(append_only=True))","handlingStrategy":"validation","validationCode":"from dataclasses import fields\n\ndef properties_consistent(column, schema_properties) -> bool:\n    for prop in (\"append_only\",):\n        c, s = getattr(column, prop, None), getattr(schema_properties, prop, None)\n        if c is not None and s is not None and c != s:\n            return False\n    return True","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Set each property at exactly one level (schema or column).","Review all column_definition flags after editing SchemaProperties defaults."],"tags":["pathway","schema","column-properties","configuration"],"backgroundTag":null,"analyzedSha":"fa2f74a4649b7c5908690cf60137263d8d80de5f","analyzedAt":"2026-08-15T01:48:17.006Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}