Skip to content

Commit

Permalink
fix len
Browse files Browse the repository at this point in the history
  • Loading branch information
kerinin committed Aug 16, 2024
1 parent 12a857e commit c857513
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions libs/knowledge-store/ragstack_knowledge_store/graph_store.py
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,7 @@ def fetch_neighborhood(neighborhood: Sequence[str]) -> None:
new_candidates = {}
for adjacent in adjacents:
if adjacent.target_content_id not in outgoing_tags:
if tag_filter.len() == 0:
if len(tag_filter) == 0:
outgoing_tags[adjacent.target_content_id] = (
adjacent.target_link_to_tags
)
Expand Down Expand Up @@ -481,7 +481,7 @@ def fetch_initial_candidates() -> None:
for row in fetched:
if row.content_id not in outgoing_tags:
candidates[row.content_id] = row.text_embedding
if tag_filter.len() == 0:
if len(tag_filter) == 0:
outgoing_tags[row.content_id] = set(row.link_to_tags or [])
else:
outgoing_tags[row.content_id] = tag_filter.intersection(
Expand Down Expand Up @@ -534,7 +534,7 @@ def fetch_initial_candidates() -> None:
new_candidates = {}
for adjacent in adjacents:
if adjacent.target_content_id not in outgoing_tags:
if tag_filter.len() == 0:
if len(tag_filter) == 0:
outgoing_tags[adjacent.target_content_id] = (
adjacent.target_link_to_tags
)
Expand Down Expand Up @@ -650,7 +650,7 @@ def visit_nodes(d: int, nodes: Sequence[Any]) -> None:
# (unless we find it an earlier depth)
visited_tags[(kind, value)] = d
if (
tag_filter.len() == 0
len(tag_filter) == 0
or (kind, value) in tag_filter
):
outgoing_tags.add((kind, value))
Expand Down

0 comments on commit c857513

Please sign in to comment.