Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion integrations/chroma/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ line-length = 120
[tool.ruff.lint]
select = [
"A",
"ANN",
"ARG",
"B",
"C",
Expand Down Expand Up @@ -111,6 +112,8 @@ select = [
ignore = [
# Allow non-abstract empty methods in abstract base classes
"B027",
# Allow `Any` - used legitimately for **kwargs and dynamic metadata values
"ANN401",
# Allow boolean positional values in function calls, like `dict.get(... True)`
"FBT003",
# Ignore checks for possible passwords
Expand Down Expand Up @@ -138,7 +141,7 @@ ban-relative-imports = "parents"

[tool.ruff.lint.per-file-ignores]
# Tests can use magic values, assertions, and relative imports
"tests/**/*" = ["PLR2004", "S101", "TID252"]
"tests/**/*" = ["PLR2004", "S101", "TID252", "ANN"]
"example/**/*" = ["T201"]

[tool.coverage.run]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def __init__(
filters: dict[str, Any] | None = None,
top_k: int = 10,
filter_policy: str | FilterPolicy = FilterPolicy.REPLACE,
):
) -> None:
"""
:param document_store: an instance of `ChromaDocumentStore`.
:param filters: filters to narrow down the search space.
Expand Down Expand Up @@ -164,7 +164,7 @@ def __init__(
filters: dict[str, Any] | None = None,
top_k: int = 10,
filter_policy: str | FilterPolicy = FilterPolicy.REPLACE,
):
) -> None:
"""
:param document_store: an instance of `ChromaDocumentStore`.
:param filters: filters to narrow down the search space.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def __init__(
metadata: dict | None = None,
client_settings: dict[str, Any] | None = None,
**embedding_function_params: Any,
):
) -> None:
"""
Creates a new ChromaDocumentStore instance.
It is meant to be connected to a Chroma collection.
Expand Down Expand Up @@ -102,7 +102,7 @@ def __init__(
self._collection: chromadb.Collection | None = None
self._async_collection: AsyncCollection | None = None

def _ensure_initialized(self):
def _ensure_initialized(self) -> None:
if not self._collection:
# Create the client instance
if self._persist_path and (self._host or self._port is not None):
Expand Down Expand Up @@ -160,7 +160,7 @@ def _ensure_initialized(self):
embedding_function=self._embedding_func,
)

async def _ensure_initialized_async(self):
async def _ensure_initialized_async(self) -> None:
if not self._async_collection:
if self._host is None or self._port is None:
error_message = (
Expand Down Expand Up @@ -341,7 +341,7 @@ def _compute_field_min_max(
for meta in metadatas:
if meta and field_name in meta:
val = meta.get(field_name)
if isinstance(val, (str, int, float)):
if isinstance(val, str | int | float):
values.append(val)

if not values:
Expand Down
Loading