find() accepts conditions that are not expressions
Bug #676751 reported by
Edwin Grubbs
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Storm |
New
|
Undecided
|
Unassigned |
Bug Description
If I have a storm class with an attribute named similarly to a storm attribute, it can be fairly easy to write a bad conditional. For example:
class MyTable(Storm):
_foo = Int()
@property
def foo(self):
...
store.find(MyTable, MyTable._foo == 9) # good query: WHERE foo=9
store.find(MyTable, MyTable.foo == 9) # bad query: WHERE FALSE
It would be nice if storm raised an exception or a warning when something that isn't a storm expression is passed in as a condition.
To post a comment you must log in.