diff --git a/evadb/utils/generic_utils.py b/evadb/utils/generic_utils.py index 5f5e366c62..59e449ea56 100644 --- a/evadb/utils/generic_utils.py +++ b/evadb/utils/generic_utils.py @@ -508,6 +508,14 @@ def is_qdrant_available() -> bool: return False +def is_pinecone_available() -> bool: + try: + try_to_import_pinecone_client() + return True + except ValueError: # noqa: E722 + return False + + ############################## ## UTILS ############################## diff --git a/test/integration_tests/long/test_similarity.py b/test/integration_tests/long/test_similarity.py index 080e73e4c4..9b30682cc1 100644 --- a/test/integration_tests/long/test_similarity.py +++ b/test/integration_tests/long/test_similarity.py @@ -15,7 +15,7 @@ import os import time import unittest -from test.markers import qdrant_skip_marker +from test.markers import pinecone_skip_marker, qdrant_skip_marker from test.util import ( create_sample_image, get_evadb_for_testing, @@ -411,6 +411,7 @@ def test_end_to_end_index_scan_should_work_correctly_on_image_dataset_qdrant(sel # Cleanup self.evadb.catalog().drop_index_catalog_entry("testQdrantIndexImageDataset") + @pinecone_skip_marker def test_end_to_end_index_scan_should_work_correctly_on_image_dataset_pinecone( self, ): diff --git a/test/markers.py b/test/markers.py index ae5b6acebb..0157a57ac7 100644 --- a/test/markers.py +++ b/test/markers.py @@ -22,6 +22,7 @@ is_forecast_available, is_gpu_available, is_ludwig_available, + is_pinecone_available, is_qdrant_available, ) @@ -34,6 +35,11 @@ reason="qdrant requires grcpio which is broken on 3.11", ) +pinecone_skip_marker = pytest.mark.skipif( + is_pinecone_available() is False, + reason="skipping since pinecone is not installed", +) + windows_skip_marker = pytest.mark.skipif( sys.platform == "win32", reason="Test case not supported on Windows" )