Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Account for change in alldocs field name from type to _type_and_ancestors #851

Merged
merged 2 commits into from
Dec 19, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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