Skip to content

Commit

Permalink
fix: handling duplicated oids
Browse files Browse the repository at this point in the history
  • Loading branch information
pgallardor committed Nov 3, 2023
1 parent aef912f commit 873ce8b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion metadata_step/metadata_step/step.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@ def _write_metadata_into_db(self, result: List[Dict]):

# Output format: [{oid: OID, ss: SS_DATA, ...}]
def execute(self, messages: List[Dict]):
oids = list(set([message["oid"] for message in messages]))
unique = {message["oid"]: message for message in messages}
oids = list(unique.keys())
messages = list(unique.values())
catalogs = {"ps1": {}, "gaia": {}}
with self.db.session() as session:
catalogs["ps1"] = get_ps1_catalog(session, oids)
Expand Down

0 comments on commit 873ce8b

Please sign in to comment.