@@ -61,7 +61,7 @@ def test_formula(collection_name, formula, expecting):
6161
6262 query = {
6363 "prefetch" : {"query" : point_id },
64- "query" : {"formula" : formula },
64+ "query" : {"formula" : formula , "defaults" : { "price" : 0.0 } },
6565 "with_payload" : True ,
6666 }
6767
@@ -77,9 +77,9 @@ def test_formula(collection_name, formula, expecting):
7777 # Assert that the response is in descending order
7878 points = response .json ()["result" ]["points" ]
7979 scores = [point .get ("score" ) for point in points ]
80- assert all (
81- scores [ i ] >= scores [ i + 1 ] for i in range ( len ( scores ) - 1 )
82- ), "Results should be ordered by score descending"
80+ assert all (scores [ i ] >= scores [ i + 1 ] for i in range ( len ( scores ) - 1 )), (
81+ "Results should be ordered by score descending"
82+ )
8383
8484 # Sanity check that the evaluation was correct
8585 for point in points :
@@ -100,9 +100,9 @@ def test_formula(collection_name, formula, expecting):
100100 point_score = point .get ("score" )
101101
102102 # Compare with actual score within floating point precision
103- assert isclose (
104- point_score , expected_score , rel_tol = 1e-5
105- ), f"Expected score { expected_score } , got { point_score } . Point: { point } "
103+ assert isclose (point_score , expected_score , rel_tol = 1e-5 ), (
104+ f"Expected score { expected_score } , got { point_score } . Point: { point } "
105+ )
106106
107107 # Assert that the response contains all points
108108 assert len (points ) == len (orig_scores ), "Response should contain all points"
0 commit comments