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
7 changes: 5 additions & 2 deletions integrations/elasticsearch/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ line-length = 120
[tool.ruff.lint]
select = [
"A",
"ANN",
"ARG",
"B",
"C",
Expand Down Expand Up @@ -125,6 +126,8 @@ ignore = [
"PLR0912",
"PLR0913",
"PLR0915",
# Allow `Any` - used legitimately for dynamic types and SDK boundaries
"ANN401",
]

[tool.ruff.lint.isort]
Expand All @@ -134,8 +137,8 @@ known-first-party = ["haystack_integrations"]
ban-relative-imports = "parents"

[tool.ruff.lint.per-file-ignores]
# Tests can use magic values, assertions, and relative imports
"tests/**/*" = ["PLR2004", "S101", "TID252"]
# Tests can use magic values, assertions, relative imports, and don't need type annotations
"tests/**/*" = ["PLR2004", "S101", "TID252", "ANN"]

[tool.coverage.run]
source = ["haystack_integrations"]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def __init__(
top_k: int = 10,
scale_score: bool = False,
filter_policy: str | FilterPolicy = FilterPolicy.REPLACE,
):
) -> None:
"""
Initialize ElasticsearchBM25Retriever with an instance ElasticsearchDocumentStore.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def __init__(
top_k: int = 10,
num_candidates: int | None = None,
filter_policy: str | FilterPolicy = FilterPolicy.REPLACE,
):
) -> None:
"""
Create the ElasticsearchEmbeddingRetriever component.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def __init__(
document_store: ElasticsearchDocumentStore,
raise_on_failure: bool = True,
fetch_size: int | None = None,
):
) -> None:
"""
Creates the ElasticsearchSQLRetriever component.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ def __init__(
api_key_id: Secret | str | None = Secret.from_env_var("ELASTIC_API_KEY_ID", strict=False),
embedding_similarity_function: Literal["cosine", "dot_product", "l2_norm", "max_inner_product"] = "cosine",
**kwargs: Any,
):
) -> None:
"""
Creates a new ElasticsearchDocumentStore instance.

Expand Down Expand Up @@ -156,7 +156,7 @@ def __init__(
],
}

def _ensure_initialized(self):
def _ensure_initialized(self) -> None:
"""
Ensures both sync and async clients are initialized and the index exists.
"""
Expand Down
Loading