Skip to content

Commit

Permalink
Merge pull request #292 from microbiomedata/291-error-initializing-sc…
Browse files Browse the repository at this point in the history
…heduler-on-spin

291 error initializing scheduler on spin
  • Loading branch information
mbthornton-lbl authored Nov 20, 2024
2 parents 21240c7 + 7660a91 commit 090b73b
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 4 deletions.
2 changes: 1 addition & 1 deletion nmdc_automation/workflow_automation/workflow_process.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def get_required_data_objects_map(db, workflows: List[WorkflowConfig]) -> Dict[s
required_types.update(set(wf.data_object_types))

required_data_objs_by_id = dict()
for rec in db.data_object_set.find():
for rec in db.data_object_set.find({"data_object_type": {"$ne": None}}):
do = DataObject(**rec)
if do.data_object_type.code.text not in required_types:
continue
Expand Down
12 changes: 11 additions & 1 deletion tests/fixtures/nmdc_db/data_object_set.json
Original file line number Diff line number Diff line change
Expand Up @@ -815,5 +815,15 @@
"data_object_type": "Metatranscriptome Expression Info File",
"url": "https://data.microbiomedata.org",
"type": "nmdc:DataObject"
}
},
{
"id" : "nmdc:dobj-13-zzzyae97",
"name" : "output: SBR_FC_N1_00-10_H2Oext_13Oct15_Leopard_1_01_4404",
"description" : "High resolution MS spectra only",
"file_size_bytes" : 30539306,
"type" : "nmdc:DataObject",
"alternative_identifiers" : [
"emsl:output_456424"
]
}
]
9 changes: 7 additions & 2 deletions tests/test_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,9 @@ def test_data_object_creation_from_records(fixtures_dir):
assert data_obj.type == "nmdc:DataObject"
assert data_obj.id == record["id"]
assert data_obj.name == record["name"]
assert str(data_obj.data_object_type) == record["data_object_type"]
# not all data objects have a data_object_type - e.g. Mass Spectrometry data
if "data_object_type" in record:
assert str(data_obj.data_object_type) == record["data_object_type"]

data_obj_dict = yaml.safe_load(yaml_dumper.dumps(data_obj))
assert data_obj_dict == record
Expand All @@ -136,9 +138,12 @@ def test_data_object_creation_from_db_records(test_db, fixtures_dir):
assert data_obj.type == "nmdc:DataObject"
assert data_obj.id == db_record["id"]
assert data_obj.name == db_record["name"]
# not all data objects have a data_object_type or url - e.g. Mass Spectrometry data
if not db_record.get("data_object_type"):
continue
assert str(data_obj.data_object_type) == db_record["data_object_type"]
assert data_obj.description == db_record["description"]
assert data_obj.url == db_record["url"]
assert data_obj.description == db_record["description"]
assert data_obj.file_size_bytes == db_record.get("file_size_bytes")
assert data_obj.md5_checksum == db_record["md5_checksum"]

Expand Down

0 comments on commit 090b73b

Please sign in to comment.