Skip to content

Commit

Permalink
Make sure query is more equivalent to incumbent
Browse files Browse the repository at this point in the history
  • Loading branch information
katybaulch committed Oct 17, 2024
1 parent 73abe96 commit e2dde3c
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions app/core/ingestion/pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,13 +113,28 @@ def generate_pipeline_ingest_input_query(
geography_subquery.c.family_import_id == Family.import_id, # type: ignore
)
.filter(FamilyDocument.document_status != DocumentStatus.DELETED)
.filter(geography_subquery.c.family_import_id == Family.import_id) # type: ignore
.options(
# Disable any default eager loading as this was causing multiplicity due to
# implicit joins due to relationships between the selected models.
# implicit joins in relationships on the selected models.
lazyload("*")
)
)
results = query.all()

results = cast(
Sequence[
Tuple[
Family,
FamilyDocument,
FamilyMetadata,
list[str],
Organisation,
Corpus,
PhysicalDocument,
]
],
query.all(),
)
return results


Expand Down

0 comments on commit e2dde3c

Please sign in to comment.