From 4c97ea116c3686cb03f566f16b0a0e9a9fd33968 Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Sun, 10 Sep 2017 23:08:30 -0400 Subject: Don't use repr() for Column/ColumnClause in warning for #4073, use the string version of the column expression in the warning, otherwise the repr() is showing the hex id which causes unlimited warnings. Change-Id: I6869b685b237e7f02c7b5071701dd63a3577182a --- lib/sqlalchemy/orm/evaluator.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/sqlalchemy/orm/evaluator.py b/lib/sqlalchemy/orm/evaluator.py index 3f2a83a02..c58aaebbf 100644 --- a/lib/sqlalchemy/orm/evaluator.py +++ b/lib/sqlalchemy/orm/evaluator.py @@ -62,9 +62,10 @@ class EvaluatorCompiler(object): key = parentmapper._columntoproperty[clause].key else: key = clause.key - if self.target_cls and key in inspect(self.target_cls).column_attrs: + if self.target_cls and \ + key in inspect(self.target_cls).column_attrs: util.warn( - "Evaluating non-mapped column expression '%r' onto " + "Evaluating non-mapped column expression '%s' onto " "ORM instances; this is a deprecated use case. Please " "make use of the actual mapped columns in ORM-evaluated " "UPDATE / DELETE expressions." % clause) -- cgit v1.2.1