Problem
You are trying to create or reference an index table of embeddings. In your Python function, you reference a catalog, schema, or table name with hyphens, such as “us3-dmo-a
” as index name.
The Python function then fails with one of the following errors depending on the use of backticks, or single or double quotes.
Error when encapsulated with backticks (`
) (catalog = '`us3-dmo-a`'
)
Value error, The `index_name` parameter must be a string in the format 'catalog.schema.index'. Received: `us3-dmo-a`.onlinehelp.online_help_vectortable_vs_index [type=value_error, input_value={'index_name': '`us3-dmo-...ne help documentation.'}, input_type=dict]
Error when only single or double quotes are used (catalog = 'us3-dmo-a'
)
ValidationError: 1 validation error for VectorSearchRetrieverTool
Value error, The `index_name` parameter must be a string in the format 'catalog.schema.index'. Received: us3-dmo-a.onlinehelp.online_help_vectortable_vs_index [type=value_error, input_value={'index_name': 'us3-dmo-a...ne help documentation.'}, input_type=dict]
Cause
Versions of databricks-langchain
below 0.4.2
contain an issue where regex validation disqualifies index names with special characters in SQL, even when formatted correctly. The issue has been mitigated in version 0.4.2
and above.
Solution
Install databricks-langchain 0.4.2
or above, as shown in the following code. You can use a notebook or the Databricks CLI.
%pip install databricks-langchain==0.4.2