From 8ba69f26532f0f60f679289702c9477e25149bf8 Mon Sep 17 00:00:00 2001 From: Yutian Li Date: Thu, 23 Sep 2021 13:33:56 -0400 Subject: [PATCH] Fix serialization of UnsupportedCompilationError Fixes #7077 --- lib/sqlalchemy/exc.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/sqlalchemy/exc.py b/lib/sqlalchemy/exc.py index a24cf7ba49..978b2ebd09 100644 --- a/lib/sqlalchemy/exc.py +++ b/lib/sqlalchemy/exc.py @@ -188,6 +188,12 @@ class UnsupportedCompilationError(CompileError): "Compiler %r can't render element of type %s%s" % (compiler, element_type, ": %s" % message if message else "") ) + self.compiler = compiler + self.element_type = element_type + self.message = message + + def __reduce__(self): + return self._class__, (self.compiler, self.element_type, self.message) class IdentifierError(SQLAlchemyError): -- 2.47.3