Skip to content

Commit

Permalink
Merge pull request #517 from hammerlab/vcf-path-col
Browse files Browse the repository at this point in the history
Drop reference to missing column
  • Loading branch information
ihodes committed Mar 5, 2015
2 parents 5893620 + 4c4b426 commit 1676d1c
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions cycledash/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,12 @@ def all_non_success_tasks():
"""Returns a map from vcf_id -> [list of unique states of its tasks]."""
update_tasks_table()
with tables(db, 'task_states') as (con, tasks):
q = (select([tasks.c.vcf_id, tasks.c.vcf_path, tasks.c.state])
q = (select([tasks.c.vcf_id, tasks.c.state])
.where(tasks.c.state != 'SUCCESS')
.distinct())

# maps either vcf_path or vcf_id to current states
# maps vcf_id to current states
ids_to_states = defaultdict(set)
for vcf_id, vcf_path, state in con.execute(q).fetchall():
if vcf_id:
ids_to_states[vcf_id].add(state)
if vcf_path:
ids_to_states[vcf_path].add(state)
for vcf_id, state in con.execute(q).fetchall():
ids_to_states[vcf_id].add(state)
return {k: list(v) for k, v in ids_to_states.iteritems()}

0 comments on commit 1676d1c

Please sign in to comment.