Skip to content

Commit d3a4f93

Browse files
authored
Migrate from databricks-vectorsearch to databricks-ai-search (#437)
## Summary `databricks-vectorsearch` is deprecated and has been renamed to `databricks-ai-search`. Follow-up to #435. When tests run, `databricks-vectorsearch` now emits: > DeprecationWarning: databricks-vectorsearch is deprecated and has been renamed to databricks-ai-search. Imports under 'databricks.vector_search.*' will continue to work as a thin re-export of 'databricks.ai_search.*', but new code should switch to 'pip install databricks-ai-search' and 'from databricks.ai_search.* import ...'. This PR follows that recommendation literally. ## Changes - **`pyproject.toml` × 4** (root, `integrations/openai`, `integrations/langchain`, `integrations/llamaindex`): replace `databricks-vectorsearch>=*` with `databricks-ai-search>=0.73`. - **12 Python files** under `src/`, `integrations/*/src/`, `integrations/*/tests/`, and `tests/`: every `from databricks.vector_search.* import ...` → `from databricks.ai_search.* import ...`. Includes `mock.patch` target strings and the `ImportError` fallback message in `databricks_langchain/vectorstores.py`. - Symbol names are unchanged. `databricks-ai-search==0.73` exposes back-compat aliases for the names the bridge uses: - `databricks/ai_search/client.py:1090`: `VectorSearchClient = AISearchClient` - `databricks/ai_search/index.py:682`: `VectorSearchIndex = AISearchIndex` - `databricks/ai_search/exceptions.py:47`: `VectorSearchException = AISearchException` - `Reranker`, `DatabricksReranker`, `CredentialStrategy` exist under the same submodule paths. Net diff: **+54 / −54 across 16 files** (pure rename). ## Validation - **Package landscape**: in a fresh venv with the migrated branch installed editable, only `databricks-ai-search==0.73` is present — `databricks-vectorsearch` is no longer pulled at all. - **Smoke**: `from databricks_openai.vector_search_retriever_tool import VectorSearchRetrieverTool` resolves `VectorSearchIndex` to `databricks.ai_search.index` even with the `databricks.vector_search` package completely absent. - **Tests**: - 53/53 openai unit tests pass. - 258/258 langchain unit tests pass (4 pre-existing skips). - `ruff check` + `ruff format --check` clean. ## Companion notes - This complements #435 (the `VectorSearchIndex` canonical-path fix). With both changes shipped, the bridge no longer touches the `databricks.vector_search.*` namespace at all and stops triggering the deprecation warning. - The langchain pyproject's `databricks-openai = { path = "../openai", editable = true }` source pin (added in #435) is preserved — still needed until the next `databricks-openai` release containing the canonical-path fix ships to PyPI; can be removed in a follow-up cleanup after that release. - Out of scope: the cross-version matrix (`openai_test (3.10, v0.x)` / `langchain_test (3.10, v0.x)`) still tests *historical* tags whose frozen source imports `databricks.vector_search.client.VectorSearchIndex`. Those tags cannot be retroactively migrated — this PR doesn't try to. Tracked separately for Dhruv. ## Test plan - [ ] CI green on this branch - [ ] After merge + release: any consumers of `databricks_ai_bridge`, `databricks_langchain`, `databricks_openai`, or `databricks_llamaindex` no longer see the upstream `DeprecationWarning` about `databricks-vectorsearch`
1 parent 4503aeb commit d3a4f93

16 files changed

Lines changed: 48 additions & 48 deletions

File tree

integrations/dspy/src/databricks_dspy/retrievers/databricks_rm.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ class DatabricksRM(dspy.Retrieve):
3939
4040
.. code-block:: python
4141
42-
from databricks.vector_search.client import VectorSearchClient
42+
from databricks.ai_search.client import VectorSearchClient
4343
from databricks.sdk import WorkspaceClient
4444
4545
# Create a Databricks workspace client

integrations/langchain/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ license = { text="Apache-2.0" }
1010
requires-python = ">=3.10"
1111
dependencies = [
1212
"langchain>=1.0.0",
13-
"databricks-vectorsearch>=0.50",
13+
"databricks-ai-search>=0.73",
1414
"databricks-ai-bridge>=0.19.0",
1515
"mlflow>=3.0.0",
1616
"pydantic>2.10.0",

integrations/langchain/src/databricks_langchain/vector_search_retriever_tool.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import json
22
from typing import Type
33

4-
from databricks.vector_search.reranker import DatabricksReranker
4+
from databricks.ai_search.reranker import DatabricksReranker
55
from databricks_ai_bridge.utils.vector_search import IndexDetails
66
from databricks_ai_bridge.vector_search_retriever_tool import (
77
FilterItem,
@@ -24,7 +24,7 @@ class VectorSearchRetrieverTool(BaseTool, VectorSearchRetrieverToolMixin):
2424
for building a retriever tool for agents.
2525
2626
**Note**: Any additional keyword arguments passed to the constructor will be passed along to
27-
`databricks.vector_search.client.VectorSearchIndex.similarity_search` when executing the tool. `See
27+
`databricks.ai_search.index.VectorSearchIndex.similarity_search` when executing the tool. `See
2828
documentation <https://api-docs.databricks.com/python/vector-search/databricks.vector_search.html#databricks.vector_search.index.VectorSearchIndex.similarity_search>`_
2929
to see the full set of supported keyword arguments,
3030
e.g. `score_threshold`. Also, see documentation for

integrations/langchain/src/databricks_langchain/vectorstores.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
)
1818

1919
import numpy as np
20+
from databricks.ai_search.reranker import DatabricksReranker, Reranker
2021
from databricks.sdk import WorkspaceClient
21-
from databricks.vector_search.reranker import DatabricksReranker, Reranker
2222
from databricks_ai_bridge.utils.vector_search import (
2323
IndexDetails,
2424
RetrieverSchema,
@@ -67,7 +67,7 @@ class DatabricksVectorSearch(VectorStore):
6767
and ``service_principal_client_secret`` to allow for
6868
service principal authentication instead of personal access token authentication.
6969
reranker: Optional reranker to apply on the top results. Pass an instance of
70-
``databricks.vector_search.reranker.DatabricksReranker`` with
70+
``databricks.ai_search.reranker.DatabricksReranker`` with
7171
``columns_to_rerank=[...]``. The reranker reorders the initial results using
7272
the specified text columns.
7373
@@ -107,7 +107,7 @@ class DatabricksVectorSearch(VectorStore):
107107
108108
.. code-block:: python
109109
110-
from databricks.vector_search.reranker import DatabricksReranker
110+
from databricks.ai_search.reranker import DatabricksReranker
111111
112112
vector_store = DatabricksVectorSearch(
113113
index_name="<your-index-name>",
@@ -249,12 +249,12 @@ def __init__(
249249
)
250250

251251
try:
252-
from databricks.vector_search.client import VectorSearchClient
253-
from databricks.vector_search.utils import CredentialStrategy
252+
from databricks.ai_search.client import VectorSearchClient
253+
from databricks.ai_search.utils import CredentialStrategy
254254
except ImportError as e:
255255
raise ImportError(
256-
"Could not import databricks-vectorsearch python package. "
257-
"Please install it with `pip install databricks-vectorsearch`."
256+
"Could not import databricks-ai-search python package. "
257+
"Please install it with `pip install databricks-ai-search`."
258258
) from e
259259

260260
if endpoint is not None:
@@ -422,7 +422,7 @@ def similarity_search(
422422
filter: Filters to apply to the query. Defaults to None.
423423
query_type: The type of this query. Supported values are "ANN" and "HYBRID".
424424
reranker: Allows reranking the results. Defaults to None.
425-
kwargs: Additional keyword arguments to pass to `databricks.vector_search.client.VectorSearchIndex.similarity_search`. `See
425+
kwargs: Additional keyword arguments to pass to `databricks.ai_search.index.VectorSearchIndex.similarity_search`. `See
426426
documentation <https://api-docs.databricks.com/python/vector-search/databricks.vector_search.html#databricks.vector_search.index.VectorSearchIndex.similarity_search>`_
427427
to see the full set of supported keyword arguments
428428
@@ -464,7 +464,7 @@ def similarity_search_with_score(
464464
filter: Filters to apply to the query. Defaults to None.
465465
query_type: The type of this query. Supported values are "ANN" and "HYBRID".
466466
reranker: Allows reranking the results. Defaults to None.
467-
kwargs: Additional keyword arguments to pass to `databricks.vector_search.client.VectorSearchIndex.similarity_search`. `See
467+
kwargs: Additional keyword arguments to pass to `databricks.ai_search.index.VectorSearchIndex.similarity_search`. `See
468468
documentation <https://api-docs.databricks.com/python/vector-search/databricks.vector_search.html#databricks.vector_search.index.VectorSearchIndex.similarity_search>`_
469469
to see the full set of supported keyword arguments
470470
@@ -538,7 +538,7 @@ def similarity_search_by_vector(
538538
filter: Filters to apply to the query. Defaults to None.
539539
query_type: The type of this query. Supported values are "ANN" and "HYBRID".
540540
reranker: Allows reranking the results. Defaults to None.
541-
kwargs: Additional keyword arguments to pass to `databricks.vector_search.client.VectorSearchIndex.similarity_search`. `See
541+
kwargs: Additional keyword arguments to pass to `databricks.ai_search.index.VectorSearchIndex.similarity_search`. `See
542542
documentation <https://api-docs.databricks.com/python/vector-search/databricks.vector_search.html#databricks.vector_search.index.VectorSearchIndex.similarity_search>`_
543543
to see the full set of supported keyword arguments
544544
@@ -591,7 +591,7 @@ def similarity_search_by_vector_with_score(
591591
filter: Filters to apply to the query. Defaults to None.
592592
query_type: The type of this query. Supported values are "ANN" and "HYBRID".
593593
reranker: Allows reranking the results. Defaults to None.
594-
kwargs: Additional keyword arguments to pass to `databricks.vector_search.client.VectorSearchIndex.similarity_search`. `See
594+
kwargs: Additional keyword arguments to pass to `databricks.ai_search.index.VectorSearchIndex.similarity_search`. `See
595595
documentation <https://api-docs.databricks.com/python/vector-search/databricks.vector_search.html#databricks.vector_search.index.VectorSearchIndex.similarity_search>`_
596596
to see the full set of supported keyword arguments
597597

integrations/langchain/tests/unit_tests/test_vector_search_retriever_tool.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66

77
import mlflow
88
import pytest
9+
from databricks.ai_search.utils import CredentialStrategy
910
from databricks.sdk import WorkspaceClient
1011
from databricks.sdk.credentials_provider import ModelServingUserCredentials
11-
from databricks.vector_search.utils import CredentialStrategy
1212
from databricks_ai_bridge.test_utils.vector_search import ( # noqa: F401
1313
ALL_INDEX_NAMES,
1414
DELTA_SYNC_INDEX,
@@ -301,7 +301,7 @@ def test_vector_search_client_model_serving_environment():
301301
host="testDogfod.com", credentials_strategy=ModelServingUserCredentials()
302302
)
303303

304-
with patch("databricks.vector_search.client.VectorSearchClient") as mockVSClient:
304+
with patch("databricks.ai_search.client.VectorSearchClient") as mockVSClient:
305305
mock_instance = mockVSClient.return_value
306306
mock_instance.get_index.side_effect = _get_index
307307
with patch("databricks.sdk.service.serving.ServingEndpointsAPI.get", return_value=None):
@@ -317,7 +317,7 @@ def test_vector_search_client_model_serving_environment():
317317

318318

319319
def test_vector_search_client_non_model_serving_environment():
320-
with patch("databricks.vector_search.client.VectorSearchClient") as mockVSClient:
320+
with patch("databricks.ai_search.client.VectorSearchClient") as mockVSClient:
321321
mock_instance = mockVSClient.return_value
322322
mock_instance.get_index.side_effect = _get_index
323323
vsTool = VectorSearchRetrieverTool(
@@ -332,7 +332,7 @@ def test_vector_search_client_with_pat_workspace_client():
332332
w.config.auth_type = "pat"
333333
w.config.host = "https://testDogfod.com"
334334
w.config.token = "fakeToken"
335-
with patch("databricks.vector_search.client.VectorSearchClient") as mockVSClient:
335+
with patch("databricks.ai_search.client.VectorSearchClient") as mockVSClient:
336336
with patch("databricks.sdk.service.serving.ServingEndpointsAPI.get", return_value=None):
337337
mock_instance = mockVSClient.return_value
338338
mock_instance.get_index.side_effect = _get_index
@@ -356,7 +356,7 @@ def test_vector_search_client_with_sp_workspace_client():
356356
w.config.client_id = "fakeClientId"
357357
w.config.client_secret = "fakeClientSecret"
358358

359-
with patch("databricks.vector_search.client.VectorSearchClient") as mockVSClient:
359+
with patch("databricks.ai_search.client.VectorSearchClient") as mockVSClient:
360360
with patch("databricks.sdk.service.serving.ServingEndpointsAPI.get", return_value=None):
361361
mock_instance = mockVSClient.return_value
362362
mock_instance.get_index.side_effect = _get_index

integrations/langchain/tests/unit_tests/test_vectorstores.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
from unittest.mock import MagicMock, patch
55

66
import pytest
7-
from databricks.vector_search.index import VectorSearchIndex
8-
from databricks.vector_search.reranker import DatabricksReranker, Reranker
7+
from databricks.ai_search.index import VectorSearchIndex
8+
from databricks.ai_search.reranker import DatabricksReranker, Reranker
99
from databricks_ai_bridge.test_utils.vector_search import (
1010
ALL_INDEX_NAMES,
1111
DELTA_SYNC_INDEX,

integrations/llamaindex/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ readme = "README.md"
99
license = { text="Apache-2.0" }
1010
requires-python = ">=3.10"
1111
dependencies = [
12-
"databricks-vectorsearch>=0.40",
12+
"databricks-ai-search>=0.73",
1313
"databricks-ai-bridge>=0.1.0",
1414
"llama-index>=0.12.0",
1515
"unitycatalog-llamaindex[databricks]>=0.2.0",

integrations/llamaindex/src/databricks_llamaindex/vector_search_retriever_tool.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ def __init__(self, **data):
4747
VectorSearchRetrieverToolMixin.__init__(self, **data)
4848

4949
# Initialize private attributes
50-
from databricks.vector_search.client import VectorSearchClient
51-
from databricks.vector_search.utils import CredentialStrategy
50+
from databricks.ai_search.client import VectorSearchClient
51+
from databricks.ai_search.utils import CredentialStrategy
5252

5353
credential_strategy = None
5454
if (

integrations/llamaindex/tests/unit_tests/test_vector_search_retriever_tool.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44
from unittest.mock import MagicMock, create_autospec, patch
55

66
import pytest
7+
from databricks.ai_search.index import VectorSearchIndex
8+
from databricks.ai_search.reranker import DatabricksReranker, Reranker
9+
from databricks.ai_search.utils import CredentialStrategy
710
from databricks.sdk import WorkspaceClient
811
from databricks.sdk.credentials_provider import ModelServingUserCredentials
9-
from databricks.vector_search.index import VectorSearchIndex
10-
from databricks.vector_search.reranker import DatabricksReranker, Reranker
11-
from databricks.vector_search.utils import CredentialStrategy
1212
from databricks_ai_bridge.test_utils.vector_search import ( # noqa: F401
1313
ALL_INDEX_NAMES,
1414
DEFAULT_VECTOR_DIMENSION,
@@ -156,7 +156,7 @@ def test_vector_search_client_model_serving_environment():
156156
host="testDogfod.com", credentials_strategy=ModelServingUserCredentials()
157157
)
158158

159-
with patch("databricks.vector_search.client.VectorSearchClient") as mockVSClient:
159+
with patch("databricks.ai_search.client.VectorSearchClient") as mockVSClient:
160160
with patch("databricks.sdk.service.serving.ServingEndpointsAPI.get", return_value=None):
161161
vsTool = VectorSearchRetrieverTool(
162162
index_name="catalog.schema.my_index_name",
@@ -172,7 +172,7 @@ def test_vector_search_client_model_serving_environment():
172172

173173

174174
def test_vector_search_client_non_model_serving_environment():
175-
with patch("databricks.vector_search.client.VectorSearchClient") as mockVSClient:
175+
with patch("databricks.ai_search.client.VectorSearchClient") as mockVSClient:
176176
vsTool = VectorSearchRetrieverTool(
177177
index_name="catalog.schema.my_index_name",
178178
text_column="abc",
@@ -182,7 +182,7 @@ def test_vector_search_client_non_model_serving_environment():
182182
mockVSClient.assert_called_once_with(disable_notice=True, credential_strategy=None)
183183

184184
w = WorkspaceClient(host="testDogfod.com", token="fakeToken")
185-
with patch("databricks.vector_search.client.VectorSearchClient") as mockVSClient:
185+
with patch("databricks.ai_search.client.VectorSearchClient") as mockVSClient:
186186
with patch("databricks.sdk.service.serving.ServingEndpointsAPI.get", return_value=None):
187187
vsTool = VectorSearchRetrieverTool(
188188
index_name="catalog.schema.my_index_name",

integrations/openai/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ readme = "README.md"
99
license = { text="Apache-2.0" }
1010
requires-python = ">=3.10"
1111
dependencies = [
12-
"databricks-vectorsearch>=0.50",
12+
"databricks-ai-search>=0.73",
1313
"databricks-ai-bridge>=0.19.0",
1414
"openai>=1.99.9",
1515
"pydantic>2.10.0",

0 commit comments

Comments
 (0)