[storm] Do aggregate queries in storm imply an ORDER BY?

Jason Baker jbaker at zeomega.com
Fri Jun 19 20:08:02 BST 2009


There's one test in tests/store/base.py that I'm running in to trouble with:

    def test_find_group_by_table(self):
        result = self.store.find(
            (Sum(FooValue.value2), Foo), Foo.id == FooValue.foo_id)
        result.group_by(Foo)
        foo1 = self.store.get(Foo, 10)
        foo2 = self.store.get(Foo, 20)
        self.assertEquals(list(result), [(5, foo1), (16, foo2)])

This test is failing because list(result) looks like this:  [(16,
foo2), (5, foo1)].  This is the same result, but in a different order.
 I know at least at the SQL level, a query such as the above wouldn't
be guaranteed to be in any order.  But is this the case with storm?



More information about the storm mailing list