Skip to content

Commit

Permalink
Account for change in alldocs field name from type to `_type_and_…
Browse files Browse the repository at this point in the history
…ancestors` (#851)

* alldocs type field name renamed to _type_and_ancestors

* style: reformat

---------

Co-authored-by: github-actions <[email protected]>
  • Loading branch information
sujaypatil96 and github-actions authored Dec 19, 2024
1 parent b328235 commit 410856f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions nmdc_runtime/api/endpoints/find.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ def process_informed_by_docs(doc, collected_objects, unique_ids):

# Process `DataGeneration` type documents linked by `was_informed_by`
if not has_output and any(
t in dg_descendants for t in doc.get("type", [])
t in dg_descendants for t in doc.get("_type_and_ancestors", [])
):
process_informed_by_docs(
doc, collected_data_objects, unique_ids
Expand All @@ -257,7 +257,9 @@ def process_informed_by_docs(doc, collected_objects, unique_ids):
if get_classname_from_typecode(op) != "DataObject"
)

if any(t in dg_descendants for t in doc.get("type", [])):
if any(
t in dg_descendants for t in doc.get("_type_and_ancestors", [])
):
process_informed_by_docs(
doc, collected_data_objects, unique_ids
)
Expand Down

0 comments on commit 410856f

Please sign in to comment.