about summary refs log tree commit diff
path: root/uploader/samples/models.py
diff options
context:
space:
mode:
Diffstat (limited to 'uploader/samples/models.py')
-rw-r--r--uploader/samples/models.py13
1 files changed, 6 insertions, 7 deletions
diff --git a/uploader/samples/models.py b/uploader/samples/models.py
index d7d5384..1e9293f 100644
--- a/uploader/samples/models.py
+++ b/uploader/samples/models.py
@@ -15,11 +15,11 @@ def samples_by_species_and_population(
     """Fetch the samples by their species and population."""
     with conn.cursor(cursorclass=DictCursor) as cursor:
         cursor.execute(
-            "SELECT iset.InbredSetId, s.* FROM InbredSet AS iset "
-            "INNER JOIN StrainXRef AS sxr ON iset.InbredSetId=sxr.InbredSetId "
-            "INNER JOIN Strain AS s ON sxr.StrainId=s.Id "
-            "WHERE s.SpeciesId=%(species_id)s "
-            "AND iset.InbredSetId=%(population_id)s",
+            "SELECT InbredSet.InbredSetId, Strain.* FROM InbredSet "
+            "INNER JOIN StrainXRef ON InbredSet.InbredSetId=StrainXRef.InbredSetId "
+            "INNER JOIN Strain ON StrainXRef.StrainId=Strain.Id "
+            "WHERE Strain.SpeciesId=%(species_id)s "
+            "AND InbredSet.InbredSetId=%(population_id)s",
             {"species_id": species_id, "population_id": population_id})
         return tuple(cursor.fetchall())
 
@@ -34,8 +34,7 @@ def read_samples_file(filepath, separator: str, firstlineheading: bool, **kwargs
                 else ("Name", "Name2", "Symbol", "Alias")),
             delimiter=separator,
             quotechar=kwargs.get("quotechar", '"'))
-        for row in reader:
-            yield row
+        yield from reader
 
 
 def save_samples_data(conn: mdb.Connection,