gmcquillan/firetower — Issue #8: archive_feature branch TimeRanges Broken
Author: gmcquillan
Created: 2011-10-16 22:39:34+00:00
State: open

The latest set of changes to the archive_feature branch seem to be passing a Redis object where we expect a Redis.Connection() instance. At least, that's what I suspect. See below.

I did pass in a Redis.Connection instance directly into the static method, which is what the constructor comments lead me to believe it expects. List output of the categories does include three category objects (which is about average for this level of accuracy).

```Python
In [1]: from firetower import category

In [2]: import redis

In [3]: conn = redis.Redis()

In [4]: cats = category.Category.get_all_categories
category.Category.get_all_categories

In [4]: cats = category.Category.get_all_categories(conn)

In [5]: for cat in cats:
...: cat.timeseries.range(0, -1)
...:
ERROR: An unexpected error occurred while tokenizing input
The following traceback may be corrupted or invalid
The error message is: ('EOF in multi-line statement', (31, 0))

---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)

/Users/gavin/src/firetower/ in ()

/Users/gavin/src/firetower/firetower/category.pyc in range(self, start, end)
12
13 def range(self, start, end):
---> 14 return self.redis_conn.zrevrangebyscore(
15 "ts_%s" % self.cat_id, end, start, withscores=True
16 )

AttributeError: 'Redis' object has no attribute 'zrevrangebyscore'
```