Skip to content

Commit

Permalink
linter fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
lelikg committed Dec 23, 2024
1 parent eef3e17 commit 84565fe
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
6 changes: 3 additions & 3 deletions libs/redis/langchain_redis/vectorstores.py
Original file line number Diff line number Diff line change
Expand Up @@ -785,7 +785,7 @@ def similarity_search_by_vector(
return_fields=return_fields,
num_results=k,
filter_expression=filter,
sort_by=sort_by
sort_by=sort_by,
)
)
else:
Expand All @@ -797,7 +797,7 @@ def similarity_search_by_vector(
num_results=k,
filter_expression=filter,
distance_threshold=distance_threshold,
sort_by=sort_by
sort_by=sort_by,
)
)

Expand Down Expand Up @@ -944,7 +944,7 @@ def similarity_search_with_score_by_vector(
return_fields=return_fields,
num_results=k,
filter_expression=filter,
sort_by=sort_by
sort_by=sort_by,
)
)
else:
Expand Down
11 changes: 5 additions & 6 deletions libs/redis/tests/integration_tests/test_vectorstores_json.py
Original file line number Diff line number Diff line change
Expand Up @@ -783,18 +783,17 @@ def test_similarity_search_with_sort_by(redis_url: str) -> None:
# Perform similarity search with metadata filtering
sort_by = "msrp"

output1 = vector_store.similarity_search(
"", k=3, sort_by=sort_by
)
output1 = vector_store.similarity_search("", k=3, sort_by=sort_by)

assert len(output1) == 3
assert output1[0].metadata["msrp"] == '22000'
assert output1[1].metadata["msrp"] == '25000'
assert output1[2].metadata["msrp"] == '35000'
assert output1[0].metadata["msrp"] == "22000"
assert output1[1].metadata["msrp"] == "25000"
assert output1[2].metadata["msrp"] == "35000"

# Clean up
vector_store.index.delete(drop=True)


def test_max_marginal_relevance_search(redis_url: str) -> None:
"""Test max marginal relevance search."""

Expand Down

0 comments on commit 84565fe

Please sign in to comment.