Handle missing schema...
This commit is contained in:
parent
b4389f0493
commit
624aee295a
@ -59,14 +59,14 @@ def query(engine, query):
|
|||||||
yield res
|
yield res
|
||||||
|
|
||||||
def distinct(engine, table, *columns, **kw):
|
def distinct(engine, table, *columns, **kw):
|
||||||
columns = [table.c[c] for c in columns]
|
|
||||||
|
|
||||||
qargs = []
|
qargs = []
|
||||||
try:
|
try:
|
||||||
|
columns = [table.c[c] for c in columns]
|
||||||
for col, val in kw.items():
|
for col, val in kw.items():
|
||||||
qargs.append(table.c[col]==val)
|
qargs.append(table.c[col]==val)
|
||||||
except KeyError:
|
except KeyError:
|
||||||
return
|
return []
|
||||||
|
|
||||||
q = expression.select(columns, distinct=True,
|
q = expression.select(columns, distinct=True,
|
||||||
whereclause=and_(*qargs),
|
whereclause=and_(*qargs),
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user