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

Search - Banish the ALN Columns #3378

Merged
merged 2 commits into from
Feb 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
14 changes: 8 additions & 6 deletions backend/dissemination/search_alns.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,17 @@ def search_alns(general_results, params):
f"search_alns general rows[{r_general_rids_matching_FA_rids.count()}]"
)

annotated = _annotate_findings(
r_general_rids_matching_FA_rids, params, r_FAs_matching_alns
)

sorted = _findings_sort(annotated, params)
# After migrating in historical data, this feature uses too much RAM/CPU.
# Disabled until we rework the expensive queries.
# annotated = _annotate_findings(
# r_general_rids_matching_FA_rids, params, r_FAs_matching_alns
# )
# sorted = _findings_sort(annotated, params)
# return sorted

t1 = time.time()
report_timing("search_alns", params, t0, t1)
return sorted
return r_general_rids_matching_FA_rids


def _findings_sort(results, params):
Expand Down
5 changes: 5 additions & 0 deletions backend/dissemination/test_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

import datetime
import random
import unittest


def assert_all_results_public(cls, results):
Expand Down Expand Up @@ -326,6 +327,7 @@ def test_aln_search(self):
results_alns_both = search_alns(results_general_both, params_both)
self.assertEqual(len(results_alns_both), 2)

@unittest.skip("Skipping while ALN columns are disabled.")
def test_finding_my_aln(self):
"""
When making an ALN search, search_general should return records under that ALN.
Expand All @@ -352,6 +354,7 @@ def test_finding_my_aln(self):
and results_alns[0].finding_all_aln is False
)

@unittest.skip("Skipping while ALN columns are disabled.")
def test_finding_all_aln(self):
"""
When making an ALN search, search_general should return records under that ALN.
Expand Down Expand Up @@ -385,6 +388,7 @@ def test_finding_all_aln(self):
and results_alns[0].finding_all_aln is True
)

@unittest.skip("Skipping while ALN columns are disabled.")
def test_finding_my_aln_and_finding_all_aln(self):
"""
When making an ALN search, search_general should return records under that ALN.
Expand Down Expand Up @@ -419,6 +423,7 @@ def test_finding_my_aln_and_finding_all_aln(self):
and results_alns[0].finding_all_aln is True
)

@unittest.skip("Skipping while ALN columns are disabled.")
def test_alns_no_findings(self):
# General record with one award and no findings.
baker.make(General, is_public=True, report_id="2022-04-TSTDAT-0000000004")
Expand Down