{"record":{"id":"f094cc7dd6774457","repo":"mlflow/mlflow","slug":"can-t-merge-property-with-non-property-type-type","errorCode":null,"errorMessage":"Can't merge property with non-property type: {type(other).__name__}","messagePattern":"Can't merge property with non-property type: (.+?)","errorType":"validation","errorClass":"MlflowException","httpStatus":null,"severity":"error","filePath":"mlflow/types/schema.py","lineNumber":302,"sourceCode":"                        ]\n                    ),\n                )\n                merged_prop = prop1._merge(prop2)\n                assert merged_prop == Property(\n                    name=\"a\",\n                    dtype=Object(\n                        properties=[\n                            Property(name=\"a\", dtype=DataType.string, required=False),\n                            Property(name=\"b\", dtype=DataType.double, required=False),\n                        ]\n                    ),\n                )\n\n        \"\"\"\n        if isinstance(other, AnyType):\n            return Property(name=self.name, dtype=self.dtype, required=False)\n        if not isinstance(other, Property):\n            raise MlflowException(\n                f\"Can't merge property with non-property type: {type(other).__name__}\"\n            )\n        if self.name != other.name:\n            raise MlflowException(\"Can't merge properties with different names\")\n        required = self.required and other.required\n        if isinstance(self.dtype, DataType) and isinstance(other.dtype, DataType):\n            if self.dtype == other.dtype:\n                return Property(name=self.name, dtype=self.dtype, required=required)\n            raise MlflowException(f\"Properties are incompatible for {self.dtype} and {other.dtype}\")\n\n        if isinstance(self.dtype, (Array, Object, Map, AnyType)):\n            obj = self.dtype._merge(other.dtype)\n            return Property(name=self.name, dtype=obj, required=required)\n\n        raise MlflowException(\"Properties are incompatible\")\n\n\nclass Object(BaseType):","sourceCodeStart":284,"sourceCodeEnd":320,"githubUrl":"https://github.com/mlflow/mlflow/blob/6a27f2decc0b76eb1b54af31849784addb357dbc/mlflow/types/schema.py#L284-L320","documentation":"Schema._merge merges two properties during schema unification (e.g. merging signatures across model versions or inputs). Merging is only defined between two Property instances; if other is not a Property (though it may be an AnyType, which is tolerated), this MlflowException is raised.","triggerScenarios":"Calling schema1.merge(schema2) / _merge where the other side contributes a non-Property entry, or invoking Property._merge(other) directly with a DataType/Array/other object instead of a Property.","commonSituations":"Custom Schema subclasses whose internal lists mix types; manual schema construction passing raw dtypes into merge logic; version drift where one path builds Properties and another passes type descriptors.","solutions":["Ensure every element passed to Schema is a Property instance (Schema accepts Property, DataType, Array, Map, Object, AnyType — merge requires Property on both sides)","Wrap raw dtypes in Property(name=..., dtype=...) before merging","Check isinstance(other, Property) before calling _merge in custom code"],"exampleFix":"// before\nschema.merge(DataType.string)\n// after\nschema.merge(Property(name=\"col\", dtype=DataType.string))","handlingStrategy":"type-guard","validationCode":"def ensure_property(x):\n    assert isinstance(x, Property), f\"expected Property, got {type(x).__name__}\"\n    return x","typeGuard":"def is_property(x) -> bool:\n    return isinstance(x, Property)","tryCatchPattern":"try:\n    merged = self._merge(other)\nexcept MlflowException as e:\n    if \"non-property type\" in str(e):\n        other = Property(name=self.name, dtype=other)\n        merged = self._merge(other)\n    else:\n        raise","preventionTips":["Only merge Schema instances built exclusively from Property objects","Wrap raw dtypes in Property(name=..., dtype=...) before any merge","Note AnyType is tolerated by _merge but anything else must be a Property"],"tags":["schema","merge","type-check"],"backgroundTag":"incompatible-types","analyzedSha":"6a27f2decc0b76eb1b54af31849784addb357dbc","analyzedAt":"2026-08-29T20:54:51.419Z","schemaVersion":2},"datasetVersion":"2026-08-29T22:17:34.462Z"}