Skip to content
Open
Show file tree
Hide file tree
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
16 changes: 8 additions & 8 deletions python/semantic_kernel/connectors/weaviate.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,13 +160,13 @@ def validate_settings(cls, data: Any) -> dict[str, Any]:

if enabled == 0:
raise ServiceInvalidExecutionSettingsError(
"Weaviate settings must specify either a ",
"Weaviate Cloud instance, a local Weaviate instance, or the client embedding options.",
"Weaviate settings must specify either a Weaviate Cloud instance, a local Weaviate "
"instance, or the client embedding options."
)
if enabled > 1:
raise ServiceInvalidExecutionSettingsError(
"Weaviate settings must specify only one of the following: ",
"Weaviate Cloud instance, a local Weaviate instance, or the client embedding options.",
"Weaviate settings must specify only one of the following: Weaviate Cloud instance, "
"a local Weaviate instance, or the client embedding options."
)

return data
Expand Down Expand Up @@ -278,8 +278,8 @@ def __init__(
async_client = use_async_with_embedded()
else:
raise NotImplementedError(
"Weaviate settings must specify either a custom client, a Weaviate Cloud instance,",
" a local Weaviate instance, or the client embedding options.",
"Weaviate settings must specify either a custom client, a Weaviate Cloud "
"instance, a local Weaviate instance, or the client embedding options."
)
except Exception as e:
raise VectorStoreInitializationException(f"Failed to initialize Weaviate client: {e}")
Expand Down Expand Up @@ -749,8 +749,8 @@ def __init__(
async_client = use_async_with_embedded()
else:
raise NotImplementedError(
"Weaviate settings must specify either a custom client, a Weaviate Cloud instance,",
" a local Weaviate instance, or the client embedding options.",
"Weaviate settings must specify either a custom client, a Weaviate Cloud "
"instance, a local Weaviate instance, or the client embedding options."
)
except Exception as e:
raise VectorStoreInitializationException(f"Failed to initialize Weaviate client: {e}")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ def test_weaviate_collection_init_with_invalid_settings_more_than_one_backends(
"""Test the initialization of a WeaviateCollection object with multiple backend options enabled."""
collection_name = "TestCollection"

with pytest.raises(ServiceInvalidExecutionSettingsError):
with pytest.raises(ServiceInvalidExecutionSettingsError, match="only one of the following"):
WeaviateCollection(
record_type=record_type,
definition=definition,
Expand All @@ -123,7 +123,7 @@ def test_weaviate_collection_init_with_invalid_settings_no_backends(
"""Test the initialization of a WeaviateCollection object with no backend options enabled."""
collection_name = "TestCollection"

with pytest.raises(ServiceInvalidExecutionSettingsError):
with pytest.raises(ServiceInvalidExecutionSettingsError, match="must specify either a Weaviate Cloud"):
WeaviateCollection(
record_type=record_type,
definition=definition,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def test_weaviate_store_init_with_invalid_settings_more_than_one_backends(
weaviate_unit_test_env,
) -> None:
"""Test the initialization of a WeaviateStore object with multiple backend options enabled."""
with pytest.raises(ServiceInvalidExecutionSettingsError):
with pytest.raises(ServiceInvalidExecutionSettingsError, match="only one of the following"):
WeaviateStore(
env_file_path="fake_env_file_path.env",
)
Expand All @@ -83,7 +83,7 @@ def test_weaviate_store_init_with_invalid_settings_no_backends(
clear_weaviate_env,
) -> None:
"""Test the initialization of a WeaviateStore object with no backend options enabled."""
with pytest.raises(ServiceInvalidExecutionSettingsError):
with pytest.raises(ServiceInvalidExecutionSettingsError, match="must specify either a Weaviate Cloud"):
WeaviateStore(
env_file_path="fake_env_file_path.env",
)
Expand Down
Loading