-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add new fieldtypes for dict score modifiers #241
Changes from all commits
2e5880b
f44629c
01b5f8e
9a53748
f2dd577
bbb2357
1abf462
b03d705
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,9 +21,9 @@ def setUp(self) -> None: | |
"my_image_field": "https://marqo-assets.s3.amazonaws.com/tests/images/image2.jpg", | ||
# 4 fields | ||
"multiply_1": 1, | ||
"multiply_2": 20.0, | ||
"multiply_2": {"a": 20.0}, | ||
"add_1": 1.0, | ||
"add_2": 30.0, | ||
"add_2": {"a": 30.0}, | ||
"_id": "1" | ||
}, | ||
{"my_text_field": "A rider is riding a horse jumping over the barrier.", | ||
|
@@ -49,11 +49,11 @@ def test_score_modifier_search_results(self): | |
"multiply_score_by": | ||
[{"field_name": "multiply_1", | ||
"weight": 1,}, | ||
{"field_name": "multiply_2",}], | ||
{"field_name": "multiply_2.a",}], | ||
"add_to_score": [ | ||
{"field_name": "add_1", "weight" : -3, | ||
}, | ||
{"field_name": "add_2", "weight": 1, | ||
{"field_name": "add_2.a", "weight": 1, | ||
}] | ||
} | ||
|
||
|
@@ -77,11 +77,11 @@ def test_invalid_score_modifiers_format(self): | |
"multiply_score_bys": | ||
[{"field_name": "multiply_1", | ||
"weight": 1,}, | ||
{"field_name": "multiply_2",}], | ||
{"field_name": "multiply_2.a",}], | ||
"add_to_score": [ | ||
{"field_name": "add_1", "weight" : 4, | ||
}, | ||
{"field_name": "add_2", "weight": 1, | ||
{"field_name": "add_2.a", "weight": 1, | ||
}] | ||
} | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think the assertion for this test is too wide. we should at least test the error code and some key word in the response if there's any |
||
|
@@ -97,7 +97,7 @@ def test_valid_score_modifiers_format(self): | |
"add_to_score": [ | ||
{"field_name": "add_1", "weight" : -3, | ||
}, | ||
{"field_name": "add_2", "weight": 1, | ||
{"field_name": "add_2.a", "weight": 1, | ||
}] | ||
} | ||
self.search_with_score_modifier(score_modifiers=valid_score_modifiers) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There's no assertion in this test. what is the expected behaviour? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So why do we need this if it's not used in any places?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't totally remove
def supported_marqo_version()
yet as someone might have a comment on its use.__marqo_version__
is removed though.