Skip to content

Commit

Permalink
Refactor based on comments from JoA
Browse files Browse the repository at this point in the history
  • Loading branch information
chuan-wang committed Sep 27, 2024
1 parent 68ae518 commit d507588
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions taca/analysis/analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,11 +162,13 @@ def _upload_to_statusdb(run):
else:
run_date = run_vals[0]
run_fc = f"{run_date}_{run_vals[-1]}"
fc_names = {e.key: e.id for e in db.view("names/name", reduce=False)}
d_id = fc_names[run_fc]
doc = db.get(d_id)
if doc.get("pdc_archived") and not parser.obj.get("pdc_archived"):
parser.obj["pdc_archived"] = doc.get("pdc_archived")
try:
doc = db.view("names/name", reduce=False, include_docs=True)[run_fc].rows[0].doc
if doc.get("pdc_archived") and not parser.obj.get("pdc_archived"):
parser.obj["pdc_archived"] = doc.get("pdc_archived")
# New FC which does not exist
except IndexError:
pass

statusdb.update_doc(db, parser.obj, over_write_db_entry=True)

Expand Down

0 comments on commit d507588

Please sign in to comment.