From a724bc53ce656df240c969bd2eb1cc49ce5e41bb Mon Sep 17 00:00:00 2001 From: Dan Tracy Date: Mon, 13 Jul 2015 13:59:23 -0400 Subject: [PATCH] Remove wonky cache lookup in execute --- sprockets/clients/cassandra/__init__.py | 3 +-- tests.py | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/sprockets/clients/cassandra/__init__.py b/sprockets/clients/cassandra/__init__.py index 8120171..75c2760 100644 --- a/sprockets/clients/cassandra/__init__.py +++ b/sprockets/clients/cassandra/__init__.py @@ -112,9 +112,8 @@ class CassandraConnection(object): keyword arguments. See cassandra-python documentation for definition of those parameters. """ - stmt = CassandraConnection._prepared_statement_cache.get(query, query) tornado_future = Future() - cassandra_future = self._session.execute_async(stmt, *args, **kwargs) + cassandra_future = self._session.execute_async(query, *args, **kwargs) self._ioloop.add_callback( self._callback, cassandra_future, tornado_future) return tornado_future diff --git a/tests.py b/tests.py index 5f36f7e..5ad5460 100644 --- a/tests.py +++ b/tests.py @@ -74,5 +74,5 @@ class TestCassandraConnectionClass(AsyncTestCase): stmt = self.connection.prepare('SELECT * FROM names;', 'get_names') copy = self.connection.prepare('SELECT * FROM names;', 'get_names') self.assertIs(stmt, copy, 'Should return the cached statement') - results = yield self.connection.execute('get_names') + results = yield self.connection.execute(stmt) self.assertEqual(results[0].name, 'Peabody')