mlflow/mlflow · error · MlflowException

Can't merge property with non-property type: {type(other).__

Error message

Can't merge property with non-property type: {type(other).__name__}

What it means

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.

Source

Thrown at mlflow/types/schema.py:302

                        ]
                    ),
                )
                merged_prop = prop1._merge(prop2)
                assert merged_prop == Property(
                    name="a",
                    dtype=Object(
                        properties=[
                            Property(name="a", dtype=DataType.string, required=False),
                            Property(name="b", dtype=DataType.double, required=False),
                        ]
                    ),
                )

        """
        if isinstance(other, AnyType):
            return Property(name=self.name, dtype=self.dtype, required=False)
        if not isinstance(other, Property):
            raise MlflowException(
                f"Can't merge property with non-property type: {type(other).__name__}"
            )
        if self.name != other.name:
            raise MlflowException("Can't merge properties with different names")
        required = self.required and other.required
        if isinstance(self.dtype, DataType) and isinstance(other.dtype, DataType):
            if self.dtype == other.dtype:
                return Property(name=self.name, dtype=self.dtype, required=required)
            raise MlflowException(f"Properties are incompatible for {self.dtype} and {other.dtype}")

        if isinstance(self.dtype, (Array, Object, Map, AnyType)):
            obj = self.dtype._merge(other.dtype)
            return Property(name=self.name, dtype=obj, required=required)

        raise MlflowException("Properties are incompatible")


class Object(BaseType):

View on GitHub (pinned to 6a27f2decc)

Solutions

  1. Ensure every element passed to Schema is a Property instance (Schema accepts Property, DataType, Array, Map, Object, AnyType — merge requires Property on both sides)
  2. Wrap raw dtypes in Property(name=..., dtype=...) before merging
  3. Check isinstance(other, Property) before calling _merge in custom code

Example fix

// before
schema.merge(DataType.string)
// after
schema.merge(Property(name="col", dtype=DataType.string))
Defensive patterns

Strategy: type-guard

Validate before calling

def ensure_property(x):
    assert isinstance(x, Property), f"expected Property, got {type(x).__name__}"
    return x

Type guard

def is_property(x) -> bool:
    return isinstance(x, Property)

Try / catch

try:
    merged = self._merge(other)
except MlflowException as e:
    if "non-property type" in str(e):
        other = Property(name=self.name, dtype=other)
        merged = self._merge(other)
    else:
        raise

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of mlflow/mlflow@6a27f2decc (2026-08-29). Data as JSON: /api/errors/f094cc7dd6774457. Report an issue: GitHub.