Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
kerinin committed Aug 15, 2024
1 parent 92e4c74 commit 6ab3d7d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
4 changes: 3 additions & 1 deletion libs/knowledge-store/ragstack_knowledge_store/graph_store.py
Original file line number Diff line number Diff line change
Expand Up @@ -484,7 +484,9 @@ def fetch_initial_candidates() -> None:
if tag_filter.len() == 0:
outgoing_tags[row.content_id] = set(row.link_to_tags or [])
else:
outgoing_tags[row.content_id] = tag_filter.intersection(set(row.link_to_tags or []))
outgoing_tags[row.content_id] = tag_filter.intersection(
set(row.link_to_tags or [])
)
helper.add_candidates(candidates)

if initial_roots:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -211,10 +211,14 @@ def test_mmr_traversal(
results = gs.mmr_traversal_search("0.0", fetch_k=2, k=4, initial_roots=["v0"])
assert _result_ids(results) == ["v1", "v3", "v2"]

results = gs.mmr_traversal_search("0.0", k=2, fetch_k=2, tag_filter=set(("explicit", "link")))
results = gs.mmr_traversal_search(
"0.0", k=2, fetch_k=2, tag_filter={("explicit", "link")}
)
assert _result_ids(results) == ["v0", "v2"]

results = gs.mmr_traversal_search("0.0", k=2, fetch_k=2, tag_filter=set(("no", "match")))
results = gs.mmr_traversal_search(
"0.0", k=2, fetch_k=2, tag_filter={("no", "match")}
)
assert _result_ids(results) == []


Expand Down

0 comments on commit 6ab3d7d

Please sign in to comment.