From b39daa128e3fe9d84c8c8cfc11f82c7524ae4a34 Mon Sep 17 00:00:00 2001 From: Adam Holmberg Date: Tue, 17 Mar 2015 16:03:20 -0500 Subject: [PATCH] Add warning when list prepend is used. --- cassandra/cqlengine/statements.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/cassandra/cqlengine/statements.py b/cassandra/cqlengine/statements.py index 23415081..f64cc7a0 100644 --- a/cassandra/cqlengine/statements.py +++ b/cassandra/cqlengine/statements.py @@ -13,13 +13,17 @@ # limitations under the License. from datetime import datetime, timedelta +import logging import time import six +import warnings from cassandra.cqlengine import UnicodeMixin from cassandra.cqlengine.functions import QueryValue from cassandra.cqlengine.operators import BaseWhereOperator, InOperator +log = logging.getLogger(__name__) + class StatementException(Exception): pass @@ -291,6 +295,11 @@ class ListUpdateClause(ContainerUpdateClause): ctx[str(ctx_id)] = self._to_database(self._assignments) ctx_id += 1 if self._prepend is not None: + msg = "Previous versions of cqlengine implicitly reversed prepended lists to account for CASSANDRA-8733. " \ + "THIS VERSION DOES NOT. This warning will be removed in a future release." + warnings.warn(msg) + log.warning(msg) + ctx[str(ctx_id)] = self._to_database(self._prepend) ctx_id += 1 if self._append is not None: