Skip to content

Commit

Permalink
Updated the kwargs for the structured query from filters to filter du…
Browse files Browse the repository at this point in the history
…e to deprecation of 'filters' for Databricks Vector Search.

Also changed the error messages as the allowed operators and comparators are different which can cause issues with functions such as get_query_constructor_prompt()
  • Loading branch information
willsmithDB committed Nov 7, 2024
1 parent 8a5b9bf commit 83d4acd
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,10 @@ def visit_operation(self, operation: Operation) -> Dict:
return self._visit_not_operation(operation)
else:
raise NotImplementedError(
f'Operator "{operation.operator}" is not supported'
f'Operator "{operation.operator}" is not supported. \
Allowable operators for Databricks Vector Search are: {[str(item) for item in self.allowed_operators]}. \

Check failure on line 80 in libs/community/langchain_community/query_constructors/databricks_vector_search.py

View workflow job for this annotation

GitHub Actions / cd libs/community / make lint #3.13

Ruff (E501)

langchain_community/query_constructors/databricks_vector_search.py:80:89: E501 Line too long (121 > 88)

Check failure on line 80 in libs/community/langchain_community/query_constructors/databricks_vector_search.py

View workflow job for this annotation

GitHub Actions / cd libs/community / make lint #3.9

Ruff (E501)

langchain_community/query_constructors/databricks_vector_search.py:80:89: E501 Line too long (121 > 88)
Be sure to pass this via the allowed_operators parameter for associated functions \

Check failure on line 81 in libs/community/langchain_community/query_constructors/databricks_vector_search.py

View workflow job for this annotation

GitHub Actions / cd libs/community / make lint #3.13

Ruff (E501)

langchain_community/query_constructors/databricks_vector_search.py:81:89: E501 Line too long (99 > 88)

Check failure on line 81 in libs/community/langchain_community/query_constructors/databricks_vector_search.py

View workflow job for this annotation

GitHub Actions / cd libs/community / make lint #3.9

Ruff (E501)

langchain_community/query_constructors/databricks_vector_search.py:81:89: E501 Line too long (99 > 88)
( i.e. get_query_constructor_prompt() )'
)

def visit_comparison(self, comparison: Comparison) -> Dict:
Expand All @@ -90,5 +93,5 @@ def visit_structured_query(
if structured_query.filter is None:
kwargs = {}
else:
kwargs = {"filters": structured_query.filter.accept(self)}
kwargs = {"filter": structured_query.filter.accept(self)}
return structured_query.query, kwargs

0 comments on commit 83d4acd

Please sign in to comment.