diff --git a/mixer/backend/sqlalchemy.py b/mixer/backend/sqlalchemy.py index 4ad4e4c..8ff0fd1 100644 --- a/mixer/backend/sqlalchemy.py +++ b/mixer/backend/sqlalchemy.py @@ -222,6 +222,12 @@ def make_fabric(self, column, field_name=None, fake=False, kwargs=None): # noqa # don't directly inherit from the base types if TypeDecorator in ftype.__bases__: ftype = ftype.impl + # In SQLAlchemy within the TypeDecorator class in SQLAlchemy, + # the impl attribute is meant to reference a SQLAlchemy TypeEngine class + # or a pre-configured instance of such a class that corresponds with the database column type to be used. + # The TypeDecorator then extends or modifies the behavior of this type. + if not inspect.isclass(ftype): + ftype = type(ftype) stype = self.__factory.cls_to_simple(ftype)