summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/orm/loading.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2014-08-31 15:22:00 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2014-08-31 15:22:00 -0400
commit3c60d3b1ca492ba77d64111f0378892acaadf36b (patch)
tree5e2df552a7142cd3bb2ef9e5236db85e5c2859f4 /lib/sqlalchemy/orm/loading.py
parent903b0a42e71c81ff99494352760c0f92fa7a486d (diff)
downloadsqlalchemy-3c60d3b1ca492ba77d64111f0378892acaadf36b.tar.gz
- A new style of warning can be emitted which will "filter" up to
N occurrences of a parameterized string. This allows parameterized warnings that can refer to their arguments to be delivered a fixed number of times until allowing Python warning filters to squelch them, and prevents memory from growing unbounded within Python's warning registries. fixes #3178
Diffstat (limited to 'lib/sqlalchemy/orm/loading.py')
-rw-r--r--lib/sqlalchemy/orm/loading.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/sqlalchemy/orm/loading.py b/lib/sqlalchemy/orm/loading.py
index a40f13fae..380afcdc7 100644
--- a/lib/sqlalchemy/orm/loading.py
+++ b/lib/sqlalchemy/orm/loading.py
@@ -562,10 +562,11 @@ def load_scalar_attributes(mapper, state, attribute_names):
if (_none_set.issubset(identity_key) and
not mapper.allow_partial_pks) or \
_none_set.issuperset(identity_key):
- util.warn("Instance %s to be refreshed doesn't "
- "contain a full primary key - can't be refreshed "
- "(and shouldn't be expired, either)."
- % state_str(state))
+ util.warn_limited(
+ "Instance %s to be refreshed doesn't "
+ "contain a full primary key - can't be refreshed "
+ "(and shouldn't be expired, either).",
+ state_str(state))
return
result = load_on_ident(