Fix incorrect returned values when getting ascendants_and_descendants#498
Fix incorrect returned values when getting ascendants_and_descendants#498
ascendants_and_descendants#498Conversation
* When `ascendants_and_descendants` are chosen, and there are entities in the precise `within_brain_region_brain_region_id`, they would be retrieved twice - once from `ascendants`, and again from the `descendants` * pagination would limit the returned objects, but could include the duplicates, which were then removed by the `unique` in `db.execute(data_query).scalars().unique()`
|
See https://github.com/openbraininstitute/prod-build-ion-channel-model/issues/50#issuecomment-3710516911 for the bug; hat-tip to @bilalesi for the report. |
Codecov Report✅ All modified and coverable lines are covered by tests.
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
|
This also should fix: |
Would it be difficult to also include a small test that covers the #747 issue just to maintain our sanity with potential regressions in the future? |
That's what the Before the fix, it would have returned 1 entry, instead of 2. |
* origin/main: Update `brain-atlas` endpoints (#506) Add published_in filter in ScientificArtifact (#505) Make nullable attributes of EMDenseReconstructionDataset (#503) Remove all endpoints that had a `InBrainRegionDep`, but don't have a brain_region_id (#501) Add pref_label/alt_label ilike_search to ETypeClass/MTypeClass filters (#500) add `number_neurons` to Simulation` (#493) Fix incorrect returned values when getting `ascendants_and_descendants` (#498)
ascendants_and_descendantsare chosen, and there are entities in the precisewithin_brain_region_brain_region_id, they would be retrieved twice - once fromascendants, and again from thedescendantsuniqueindb.execute(data_query).scalars().unique()page_size