Skip to content

Commit

Permalink
fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
jiashenC committed Sep 25, 2023
1 parent f4e51bf commit ea3b7e1
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 11 deletions.
3 changes: 1 addition & 2 deletions evadb/catalog/services/index_catalog_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import os
from pathlib import Path

from sqlalchemy.orm import Session
from sqlalchemy.orm.exc import NoResultFound
Expand Down Expand Up @@ -76,7 +75,7 @@ def delete_entry_by_name(self, name: str):
# clean up the on disk data
if os.path.exists(index_metadata.save_file_path):
if os.path.isfile(index_metadata.save_file_path):
# For service-hosting-based vector database, we should not
# For service-hosting-based vector database, we should not
# touch their base directory. The only case that needs to
# be taken care of is FAISS index local disk file.
os.remove(index_metadata.save_file_path)
Expand Down
1 change: 0 additions & 1 deletion evadb/third_party/vector_stores/chromadb.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
from typing import List
from pathlib import Path

from evadb.third_party.vector_stores.types import (
FeaturePayload,
Expand Down
32 changes: 24 additions & 8 deletions test/integration_tests/long/test_similarity.py
Original file line number Diff line number Diff line change
Expand Up @@ -388,11 +388,15 @@ def test_end_to_end_index_scan_should_work_correctly_on_image_dataset_faiss(self
LIMIT 1;""".format(
self.img_path
)
explain_batch = execute_query_fetch_all(self.evadb, f"EXPLAIN {select_query}")
explain_batch = execute_query_fetch_all(
self.evadb, f"EXPLAIN {select_query}"
)
self.assertTrue("VectorIndexScan" in explain_batch.frames[0][0])

res_batch = execute_query_fetch_all(self.evadb, select_query)
self.assertEqual(res_batch.frames["testsimilarityimagedataset._row_id"][0], 5)
self.assertEqual(
res_batch.frames["testsimilarityimagedataset._row_id"][0], 5
)

# Cleanup
drop_query = "DROP INDEX testFaissIndexImageDataset"
Expand All @@ -411,7 +415,9 @@ def test_end_to_end_index_scan_should_work_correctly_on_image_dataset_qdrant(sel
LIMIT 1;""".format(
self.img_path
)
explain_batch = execute_query_fetch_all(self.evadb, f"EXPLAIN {select_query}")
explain_batch = execute_query_fetch_all(
self.evadb, f"EXPLAIN {select_query}"
)
self.assertTrue("VectorIndexScan" in explain_batch.frames[0][0])

"""|__ ProjectPlan
Expand All @@ -420,7 +426,9 @@ def test_end_to_end_index_scan_should_work_correctly_on_image_dataset_qdrant(sel
|__ StoragePlan"""

res_batch = execute_query_fetch_all(self.evadb, select_query)
self.assertEqual(res_batch.frames["testsimilarityimagedataset._row_id"][0], 5)
self.assertEqual(
res_batch.frames["testsimilarityimagedataset._row_id"][0], 5
)

# Cleanup
drop_query = "DROP INDEX testQdrantIndexImageDataset"
Expand All @@ -441,11 +449,15 @@ def test_end_to_end_index_scan_should_work_correctly_on_image_dataset_chromadb(
LIMIT 1;""".format(
self.img_path
)
explain_batch = execute_query_fetch_all(self.evadb, f"EXPLAIN {select_query}")
explain_batch = execute_query_fetch_all(
self.evadb, f"EXPLAIN {select_query}"
)
self.assertTrue("VectorIndexScan" in explain_batch.frames[0][0])

res_batch = execute_query_fetch_all(self.evadb, select_query)
self.assertEqual(res_batch.frames["testsimilarityimagedataset._row_id"][0], 5)
self.assertEqual(
res_batch.frames["testsimilarityimagedataset._row_id"][0], 5
)

# Cleanup
drop_query = "DROP INDEX testChromaDBIndexImageDataset"
Expand All @@ -468,11 +480,15 @@ def test_end_to_end_index_scan_should_work_correctly_on_image_dataset_pinecone(
LIMIT 1;""".format(
self.img_path
)
explain_batch = execute_query_fetch_all(self.evadb, f"EXPLAIN {select_query}")
explain_batch = execute_query_fetch_all(
self.evadb, f"EXPLAIN {select_query}"
)
self.assertTrue("VectorIndexScan" in explain_batch.frames[0][0])

res_batch = execute_query_fetch_all(self.evadb, select_query)
self.assertEqual(res_batch.frames["testsimilarityimagedataset._row_id"][0], 5)
self.assertEqual(
res_batch.frames["testsimilarityimagedataset._row_id"][0], 5
)

drop_index_query = "DROP INDEX testpineconeindeximagedataset;"
execute_query_fetch_all(self.evadb, drop_index_query)

0 comments on commit ea3b7e1

Please sign in to comment.