mirror of
https://github.com/hwchase17/langchain.git
synced 2025-09-17 23:41:46 +00:00
ruff: add bugbear across packages (#31917)
WIP, other packages will get in next PRs
This commit is contained in:
@@ -479,7 +479,7 @@ class Chroma(VectorStore):
|
||||
"Try filtering complex metadata using "
|
||||
"langchain_community.vectorstores.utils.filter_complex_metadata."
|
||||
)
|
||||
raise ValueError(e.args[0] + "\n\n" + msg)
|
||||
raise ValueError(e.args[0] + "\n\n" + msg) from e
|
||||
raise e
|
||||
if empty_ids:
|
||||
images_without_metadatas = [b64_texts[j] for j in empty_ids]
|
||||
@@ -566,7 +566,7 @@ class Chroma(VectorStore):
|
||||
"Try filtering complex metadata from the document using "
|
||||
"langchain_community.vectorstores.utils.filter_complex_metadata."
|
||||
)
|
||||
raise ValueError(e.args[0] + "\n\n" + msg)
|
||||
raise ValueError(e.args[0] + "\n\n" + msg) from e
|
||||
raise e
|
||||
if empty_ids:
|
||||
texts_without_metadatas = [texts[j] for j in empty_ids]
|
||||
|
@@ -64,6 +64,7 @@ target-version = "py39"
|
||||
[tool.ruff.lint]
|
||||
select = [
|
||||
"A", # flake8-builtins
|
||||
"B", # flake8-bugbear
|
||||
"ASYNC", # flake8-async
|
||||
"C4", # flake8-comprehensions
|
||||
"COM", # flake8-commas
|
||||
|
@@ -787,7 +787,7 @@ def test_collection_none_after_delete(
|
||||
_ = vectorstore._collection
|
||||
with pytest.raises(Exception, match="does not exist"):
|
||||
vectorstore._client.get_collection("test_collection")
|
||||
with pytest.raises(Exception):
|
||||
with pytest.raises(Exception): # noqa: B017
|
||||
vectorstore.similarity_search("foo")
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user