[Checkins] SVN: Sandbox/adamg/ocql/trunk/src/ocql/ fixes made to failing tests
Charith Paranaliyanage
paranaliyanage at gmail.com
Tue Sep 2 11:49:51 EDT 2008
Log message for revision 90714:
fixes made to failing tests
Changed:
U Sandbox/adamg/ocql/trunk/src/ocql/compiler/compiler.py
U Sandbox/adamg/ocql/trunk/src/ocql/compiler/compiler.txt
U Sandbox/adamg/ocql/trunk/src/ocql/compiler/compiler_optimized.txt
U Sandbox/adamg/ocql/trunk/src/ocql/queryobject/interfaces.py
U Sandbox/adamg/ocql/trunk/src/ocql/queryobject/queryobject.py
U Sandbox/adamg/ocql/trunk/src/ocql/tests/functions.txt
-=-
Modified: Sandbox/adamg/ocql/trunk/src/ocql/compiler/compiler.py
===================================================================
--- Sandbox/adamg/ocql/trunk/src/ocql/compiler/compiler.py 2008-09-02 15:20:34 UTC (rev 90713)
+++ Sandbox/adamg/ocql/trunk/src/ocql/compiler/compiler.py 2008-09-02 15:49:51 UTC (rev 90714)
@@ -229,7 +229,7 @@
adapts(IBinary)
def __call__(self):
- return '%s%s%s' % (
+ return '%s %s %s' % (
compile(self.context.left),
self.context.op.op,
compile(self.context.right))
Modified: Sandbox/adamg/ocql/trunk/src/ocql/compiler/compiler.txt
===================================================================
--- Sandbox/adamg/ocql/trunk/src/ocql/compiler/compiler.txt 2008-09-02 15:20:34 UTC (rev 90713)
+++ Sandbox/adamg/ocql/trunk/src/ocql/compiler/compiler.txt 2008-09-02 15:49:51 UTC (rev 90714)
@@ -124,7 +124,7 @@
>>> aopt
Head(Iter(<type 'list'>, Lambda c: If(c.credits > `3`, Single(<type 'list'>, c.code), Empty(<type 'list'>)), Make(<type 'list'>, <type 'set'>, ICourse)))
>>> run.code
- 'reduce(operator.add, map(lambda c: ((c.credits>3) and ([c.code]) or ([])), list(metadata.getAll("ICourse"))), [])'
+ 'reduce(operator.add, map(lambda c: ((c.credits > 3) and ([c.code]) or ([])), list(metadata.getAll("ICourse"))), [])'
>>> aopt, run = make("set [ c in ICourse; a as c.credits; a > 3 | c.code ]")
@@ -133,4 +133,4 @@
Lambda a: If(a > `3`, Single(<type 'set'>, c.code), Empty(<type 'set'>)),
Single(<type 'set'>, c.credits)), Make(<type 'set'>, <type 'set'>, ICourse)))
>>> run.code
- 'reduce(set.union, map(lambda c: reduce(set.union, map(lambda a: ((a>3) and (set([c.code])) or (set())), set([c.credits])), set()), set(metadata.getAll("ICourse"))), set())'
+ 'reduce(set.union, map(lambda c: reduce(set.union, map(lambda a: ((a > 3) and (set([c.code])) or (set())), set([c.credits])), set()), set(metadata.getAll("ICourse"))), set())'
Modified: Sandbox/adamg/ocql/trunk/src/ocql/compiler/compiler_optimized.txt
===================================================================
--- Sandbox/adamg/ocql/trunk/src/ocql/compiler/compiler_optimized.txt 2008-09-02 15:20:34 UTC (rev 90713)
+++ Sandbox/adamg/ocql/trunk/src/ocql/compiler/compiler_optimized.txt 2008-09-02 15:49:51 UTC (rev 90714)
@@ -62,7 +62,7 @@
>>> run
RunnableQuery:
reduce(set.union,
- map(lambda i: ((i.value==5) and (set([i.name])) or (set())),
+ map(lambda i: ((i.value == 5) and (set([i.name])) or (set())),
set(metadata.getAll("IUnOptimizedClass"))), set())
Results of the query:
Modified: Sandbox/adamg/ocql/trunk/src/ocql/queryobject/interfaces.py
===================================================================
--- Sandbox/adamg/ocql/trunk/src/ocql/queryobject/interfaces.py 2008-09-02 15:20:34 UTC (rev 90713)
+++ Sandbox/adamg/ocql/trunk/src/ocql/queryobject/interfaces.py 2008-09-02 15:49:51 UTC (rev 90714)
@@ -83,7 +83,7 @@
"""
collection_type = Attribute('collection type')
identifier = Attribute('identifier')
- terms = Attribute('terms')
+ elements = Attribute('elements')
class IIn(ITerm):
"""Objects providing this interface represent the
@@ -99,7 +99,6 @@
"""Objects providing this interface represent the
Range Query object
"""
- collection = Attribute('collection type')
start = Attribute('range start point')
end = Attribute('range end point')
Modified: Sandbox/adamg/ocql/trunk/src/ocql/queryobject/queryobject.py
===================================================================
--- Sandbox/adamg/ocql/trunk/src/ocql/queryobject/queryobject.py 2008-09-02 15:20:34 UTC (rev 90713)
+++ Sandbox/adamg/ocql/trunk/src/ocql/queryobject/queryobject.py 2008-09-02 15:49:51 UTC (rev 90714)
@@ -220,13 +220,6 @@
else:
self.setProperties('elements', elements)
- def addSymbol(self):
- s = self.symbols.current()
- s[self.identifier] = self.__class__.__name__
-
- def get_collection_type(self):
- return self.__class__.__name__
-
def __repr__(self):
return "%s(%s, %s, %s)" % (
self.__class__.__name__,
Modified: Sandbox/adamg/ocql/trunk/src/ocql/tests/functions.txt
===================================================================
--- Sandbox/adamg/ocql/trunk/src/ocql/tests/functions.txt 2008-09-02 15:20:34 UTC (rev 90713)
+++ Sandbox/adamg/ocql/trunk/src/ocql/tests/functions.txt 2008-09-02 15:49:51 UTC (rev 90714)
@@ -130,19 +130,19 @@
Sample from the presentation:
>>> engine.compile("set [ c in ICourse; a as c.credits; a < 2 | a ]").execute()
- set([Course <C2>], Course <C3>])
+ set([])
Sample from the presentation:
- >>> engine.compile("set [ c in ICourse; a as c.credits; a > 2 | c ]").execute()
- set([Course <C2>], Course <C3>])
+ >>> sorted(engine.compile("set [ c in ICourse; a as c.credits; a > 2 | c ]").execute())
+ [Course <C2>, Course <C3>]
Sample from the presentation:
>>> engine.compile("set [ s in IStudent; a as s.major.address.street; a=='Hillhead Street' | s ]").execute()
- Student2
+ set([Student <St2>])
Sample from the presentation:
>>> engine.compile("set [ s in IStudent; a as s.major.address.street; a=='Hillhead Street' or a=='Gibson Street' | s ]").execute()
- Student1, Student2
+ set([Student <St1>, Student <St2>])
More test ideas:
engine.compile("""list [ d in IDepartment; c in ICourse; d == some c.runBy | list {d.name, c} ]""").execute()
More information about the Checkins
mailing list