diff --git a/hasher-matcher-actioner/src/OpenMediaMatch/blueprints/matching.py b/hasher-matcher-actioner/src/OpenMediaMatch/blueprints/matching.py index 801377196..3265da887 100644 --- a/hasher-matcher-actioner/src/OpenMediaMatch/blueprints/matching.py +++ b/hasher-matcher-actioner/src/OpenMediaMatch/blueprints/matching.py @@ -39,7 +39,7 @@ class MatchWithDistance(t.TypedDict): content_id: int distance: str - + banks: list[str] @dataclass class _SignalIndexInMemoryCache: @@ -151,11 +151,13 @@ def lookup_signal(signal: str, signal_type_name: str) -> list[int]: def lookup_signal_with_distance( signal: str, signal_type_name: str ) -> list[MatchWithDistance]: + banks = lookup(signal, signal_type_name) results = query_index(signal, signal_type_name) return [ { "content_id": m.metadata, "distance": m.similarity_info.pretty_str(), + "banks": banks, } for m in results ] diff --git a/hasher-matcher-actioner/src/OpenMediaMatch/tests/test_e2e_workflow.py b/hasher-matcher-actioner/src/OpenMediaMatch/tests/test_e2e_workflow.py index 942ce8bd8..b9c7c1fd7 100644 --- a/hasher-matcher-actioner/src/OpenMediaMatch/tests/test_e2e_workflow.py +++ b/hasher-matcher-actioner/src/OpenMediaMatch/tests/test_e2e_workflow.py @@ -70,4 +70,4 @@ def test_raw_hash_add_to_match_with_distance(app: Flask, client: FlaskClient): f"/m/raw_lookup?signal_type=pdq&include_distance=true&signal={hashes[-1]}" ) assert resp.status_code == 200 - assert resp.json == {"matches": [{"content_id": 16, "distance": "0"}]} + assert resp.json == {"matches": [{"content_id": 16, "distance": "0", "banks": ["TEST_BANK"]}]}