Skip to content

Commit 27962ce

Browse files
lasagna0graphite-app[bot]mdrxy
authored andcommitted
Correct misleading CosmosDB connection string validation error message (#315)
### Description The current error message when validating `cosmosdb_connection_string` is misleading. In the previous version it stated: > "CosmosDB connection string **CAN BE EMPTY**" when in fact the correct behavior is that it **cannot** be empty. This PR updates the `ValueError` to properly reflect the restriction. ### Changes ```python self._validate_enum_value(kind, CosmosDBVectorSearchType) if not cosmosdb_connection_string: raise ValueError("CosmosDB connection string can't be empty.") self.cosmosdb_connection_string = cosmosdb_connection_string self.cosmosdb_client = cosmosdb_client ``` ### Expected Behavior When the `cosmosdb_connection_string` parameter is empty, the following clear error is raised: ``` ValueError: CosmosDB connection string can't be empty. ``` --------- Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com> Co-authored-by: Mason Daugherty <[email protected]>
1 parent d1c18a0 commit 27962ce

File tree

1 file changed

+1
-1
lines changed
  • libs/community/langchain_community

1 file changed

+1
-1
lines changed

libs/community/langchain_community/cache.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2153,7 +2153,7 @@ def __init__(
21532153
self._validate_enum_value(kind, CosmosDBVectorSearchType)
21542154

21552155
if not cosmosdb_connection_string:
2156-
raise ValueError(" CosmosDB connection string can be empty.")
2156+
raise ValueError("CosmosDB connection string can't be empty.")
21572157

21582158
self.cosmosdb_connection_string = cosmosdb_connection_string
21592159
self.cosmosdb_client = cosmosdb_client

0 commit comments

Comments
 (0)