diff --git a/nmdc_automation/import_automation/activity_mapper.py b/nmdc_automation/import_automation/activity_mapper.py index a3e97ba5..87970b51 100644 --- a/nmdc_automation/import_automation/activity_mapper.py +++ b/nmdc_automation/import_automation/activity_mapper.py @@ -120,9 +120,10 @@ def map_sequencing_data(self) -> Tuple[nmdc.Database, Dict]: db.data_object_set.append(DataObject(**do_record)) has_output.append(data_object_id) update = { - "collection": "data_generation_set", - "filter": {"id": self.nucelotide_sequencing_id}, - "update": {"$addToSet": {"has_output": has_output}} + "update": "data_generation_set", + "updates": [ + {"q": {"id": self.nucelotide_sequencing_id}, "u": {"$addToSet": {"has_output": has_output[0]}}} + ] } # update self.data_object_map if len(has_output) > 1: diff --git a/nmdc_automation/run_process/run_import.py b/nmdc_automation/run_process/run_import.py index 922765d3..970f3791 100644 --- a/nmdc_automation/run_process/run_import.py +++ b/nmdc_automation/run_process/run_import.py @@ -85,6 +85,7 @@ def import_projects(import_file, import_yaml, site_configuration, iteration): runtime.run_query(data_generation_update) except Exception as e: logger.error(f"Error applying update to sequencing data generation: {e}") + logger.error(data_generation_update) raise e diff --git a/tests/test_imports.py b/tests/test_imports.py index 2ef2a40d..29b2c637 100644 --- a/tests/test_imports.py +++ b/tests/test_imports.py @@ -42,9 +42,10 @@ def test_gold_mapper_map_sequencing_data(gold_mapper): exp_dobj_type = "Metagenome Raw Reads" # From the gold_import_files fixture exp_nucleotide_sequencing_id = "nmdc:omprc-11-importT" # From the gold mapper fixture exp_update = { - "collection": "data_generation_set", - "filter": {"id": exp_nucleotide_sequencing_id}, - "update": {"$addToSet": {"has_output": [exp_dobj_id]}} + "update": "data_generation_set", + "updates": [ + {"q": {"id": exp_nucleotide_sequencing_id}, "u": {"$addToSet": {"has_output": exp_dobj_id}}} + ], } # Sequencing data does not get a URL exp_url = None