Skip to content
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

remove unnecessary test, change atol #230

Open
wants to merge 1 commit into
base: mainline
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 3 additions & 16 deletions tests/v2_tests/test_embed.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,9 +131,9 @@ def test_embed_list_content(self):
self.assertIn("processingTimeMs", embed_res)
self.assertEqual(embed_res["content"], [{"Jimmy Butler is the GOAT.": 1}, "Alex Caruso is the GOAT."])
self.assertTrue(
np.allclose(embed_res["embeddings"][0], retrieved_docs["results"][0]["_tensor_facets"][0]["_embedding"]))
np.allclose(embed_res["embeddings"][0], retrieved_docs["results"][0]["_tensor_facets"][0]["_embedding"], atol=1e-6))
self.assertTrue(
np.allclose(embed_res["embeddings"][1], retrieved_docs["results"][1]["_tensor_facets"][0]["_embedding"]))
np.allclose(embed_res["embeddings"][1], retrieved_docs["results"][1]["_tensor_facets"][0]["_embedding"], atol=1e-6))


def test_embed_non_numeric_weight_fails(self):
Expand All @@ -146,17 +146,4 @@ def test_embed_non_numeric_weight_fails(self):
with self.assertRaises(MarqoWebError) as e:
self.client.index(test_index_name).embed(content={"text to embed": "not a number"})

self.assertIn("not a valid float", str(e.exception))


def test_embed_empty_content(self):
for cloud_test_index_to_use, open_source_test_index_name in self.test_cases:
test_index_name = self.get_test_index_name(
cloud_test_index_to_use=cloud_test_index_to_use,
open_source_test_index_name=open_source_test_index_name
)
with (self.subTest(test_index_name)):
with self.assertRaises(MarqoWebError) as e:
self.client.index(test_index_name).embed(content=[])

self.assertIn("bruh should not be empty", str(e.exception))
self.assertIn("not a valid float", str(e.exception))
Loading