Skip to content

Commit 87bcc10

Browse files
authored
Merge pull request #176 from aanil/aggreg_qc
Fix bug with concatenation of processids to query in loop
2 parents 71d60f9 + f7834ee commit 87bcc10

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

LIMS2DB/classes.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -947,18 +947,16 @@ def get_library_preps(self, sample):
947947
# If only Aggregate QC step exists, use it even if it's a pool
948948
if len(agrlibvals) == 1:
949949
agrlibval = agrlibvals[0]
950-
query += f"{agrlibval.processid}"
951950
try:
952-
inp_artifact = self.session.query(Artifact).from_statement(text(query)).first()
951+
inp_artifact = self.session.query(Artifact).from_statement(text(query + f"{agrlibval.processid}")).first()
953952
except NoResultFound:
954953
pass
955954
else:
956955
for agrlv in agrlibvals:
957956
# for small rna (and maybe others), there is more than one agrlibval, and I should not get the latest one,
958957
# but the latest one that ran at sample level, not a pool level.
959-
query += f"{agrlv.processid}"
960958
try:
961-
inp_artifact = self.session.query(Artifact).from_statement(text(query)).first()
959+
inp_artifact = self.session.query(Artifact).from_statement(text(query + f"{agrlv.processid}")).first()
962960

963961
# We want the QC results of individual sample, not library pool
964962
if (

0 commit comments

Comments
 (0)