Skip to content

Commit 934f87e

Browse files
Small fixes
1 parent 00a8d14 commit 934f87e

File tree

3 files changed

+17
-10
lines changed

3 files changed

+17
-10
lines changed

neomodel/async_/match.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -578,7 +578,7 @@ def build_vector_query(self):
578578
)
579579

580580
if type(vector_filter.threshold) not in [float, type(None)]:
581-
raise ValueError(f"Vector Filter Threshold must be a float or None.")
581+
raise ValueError("Vector Filter Threshold must be a float or None.")
582582

583583
vector_filter.index_name = f"vector_index_{source_class.__label__}_{vector_filter.vector_attribute_name}"
584584
vector_filter.node_set_label = source_class.__label__.lower()
@@ -587,7 +587,6 @@ def build_vector_query(self):
587587
self._ast.return_clause = f"{vector_filter.node_set_label}, score"
588588
self._ast.result_class = source_class.__class__
589589

590-
591590
def build_fulltext_query(self):
592591
"""
593592
Query a free text indexed property on the node.
@@ -609,7 +608,7 @@ def build_fulltext_query(self):
609608
)
610609

611610
if type(full_text_filter.threshold) not in [float, type(None)]:
612-
raise ValueError(f"Full Text Filter Threshold must be a float or None.")
611+
raise ValueError("Full Text Filter Threshold must be a float or None.")
613612

614613
full_text_filter.index_name = f"fulltext_index_{source_class.__label__}_{full_text_filter.fulltext_attribute_name}"
615614
full_text_filter.node_set_label = source_class.__label__.lower()

neomodel/semantic_filters.py

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
from typing import Union
2-
31
class VectorFilter(object):
42
"""
53
Represents a CALL db.index.vector.query* neo functions call within the OGM
@@ -16,7 +14,11 @@ class VectorFilter(object):
1614
"""
1715

1816
def __init__(
19-
self, topk: int, vector_attribute_name: str, candidate_vector: list[float], threshold: Union[float, None] = None
17+
self,
18+
topk: int,
19+
vector_attribute_name: str,
20+
candidate_vector: list[float],
21+
threshold: float | None = None,
2022
):
2123
self.topk = topk
2224
self.vector_attribute_name = vector_attribute_name
@@ -25,9 +27,10 @@ def __init__(
2527
self.node_set_label = None
2628
self.vector = candidate_vector
2729

30+
2831
class FulltextFilter(object):
2932
"""
30-
Represents a CALL db.index.fulltext.query* neo functon call within the OGM.
33+
Represents a CALL db.index.fulltext.query* neo function call within the OGM.
3134
:param query_strng: The string you are finding the nearest
3235
:type query_string: str
3336
:param freetext_attribute_name: The property name for the free text indexed property.
@@ -39,7 +42,12 @@ class FulltextFilter(object):
3942
4043
"""
4144

42-
def __init__(self, query_string: str, fulltext_attribute_name: str, topk: int, threshold: Union[float, None] = None
45+
def __init__(
46+
self,
47+
query_string: str,
48+
fulltext_attribute_name: str,
49+
topk: int,
50+
threshold: float | None = None,
4351
):
4452
self.topk = topk
4553
self.query_string = query_string

neomodel/sync_/match.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -576,7 +576,7 @@ def build_vector_query(self):
576576
)
577577

578578
if type(vector_filter.threshold) not in [float, type(None)]:
579-
raise ValueError(f"Vector Filter Threshold must be a float or None.")
579+
raise ValueError("Vector Filter Threshold must be a float or None.")
580580

581581
vector_filter.index_name = f"vector_index_{source_class.__label__}_{vector_filter.vector_attribute_name}"
582582
vector_filter.node_set_label = source_class.__label__.lower()
@@ -606,7 +606,7 @@ def build_fulltext_query(self):
606606
)
607607

608608
if type(full_text_filter.threshold) not in [float, type(None)]:
609-
raise ValueError(f"Full Text Filter Threshold must be a float or None.")
609+
raise ValueError("Full Text Filter Threshold must be a float or None.")
610610

611611
full_text_filter.index_name = f"fulltext_index_{source_class.__label__}_{full_text_filter.fulltext_attribute_name}"
612612
full_text_filter.node_set_label = source_class.__label__.lower()

0 commit comments

Comments
 (0)