Skip to content

Commit ec8c228

Browse files
authored
Merge pull request #2 from Cameron-Van-Eck/main
Now getting SBID from observation table, not observation_state.
2 parents 47a86c5 + e4912a6 commit ec8c228

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

automation/database_queries.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -567,9 +567,11 @@ def get_fields_ready_single_SB_pipeline(band_number, conn) -> Table:
567567
returns a table with columns ["name", "sbid"]
568568
"""
569569
sql = f"""
570-
SELECT name, sbid FROM possum.observation_state_band{band_number}
571-
WHERE ("single_sb_1d_pipeline" IS NULL or "single_sb_1d_pipeline" = '')
572-
AND UPPER("cube_state") = 'COMPLETED';
570+
SELECT s.name, o.sbid FROM possum.observation_state_band{band_number} s, possum.observation o
571+
WHERE s.name = o.name
572+
AND
573+
(s."single_sb_1d_pipeline" IS NULL or s."single_sb_1d_pipeline" = '')
574+
AND UPPER(s."cube_state") = 'COMPLETED';
573575
"""
574576
rows, colnames = execute_query(sql, conn, return_colnames=True)
575577
return rows_to_table(rows, colnames=colnames)

0 commit comments

Comments
 (0)