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
4 changes: 3 additions & 1 deletion integrations/stackit/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ line-length = 120
[tool.ruff.lint]
select = [
"A",
"ANN",
"ARG",
"B",
"C",
Expand All @@ -105,6 +106,7 @@ select = [
]
ignore = [
# Allow non-abstract empty methods in abstract base classes
"ANN401",
"B027",
# Ignore checks for possible passwords
"S105",
Expand All @@ -129,7 +131,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/**/*" = ["ANN", "PLR2004", "S101", "TID252"]

[tool.coverage.run]
source = ["haystack_integrations"]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def __init__(
timeout: float | None = None,
max_retries: int | None = None,
http_client_kwargs: dict[str, Any] | None = None,
):
) -> None:
"""
Creates a STACKITDocumentEmbedder component.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def __init__(
timeout: float | None = None,
max_retries: int | None = None,
http_client_kwargs: dict[str, Any] | None = None,
):
) -> None:
"""
Creates a STACKITTextEmbedder component.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def __init__(
timeout: float | None = None,
max_retries: int | None = None,
http_client_kwargs: dict[str, Any] | None = None,
):
) -> None:
"""
Creates an instance of STACKITChatGenerator class.

Expand Down
5 changes: 4 additions & 1 deletion integrations/togetherai/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ line-length = 120
[tool.ruff.lint]
select = [
"A",
"ANN",
"ARG",
"B",
"C",
Expand All @@ -112,6 +113,7 @@ select = [
]
ignore = [
# Allow non-abstract empty methods in abstract base classes
"ANN401",
"B027",
# Ignore checks for possible passwords
"S105",
Expand All @@ -133,7 +135,8 @@ ban-relative-imports = "parents"

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def __init__(
timeout: float | None = None,
max_retries: int | None = None,
http_client_kwargs: dict[str, Any] | None = None,
):
) -> None:
"""
Creates an instance of TogetherAIChatGenerator. Unless specified otherwise,
the default model is `meta-llama/Llama-3.3-70B-Instruct-Turbo`.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def __init__(
generation_kwargs: dict[str, Any] | None = None,
timeout: float | None = None,
max_retries: int | None = None,
):
) -> None:
"""
Initialize the TogetherAIGenerator.

Expand Down
4 changes: 3 additions & 1 deletion integrations/unstructured/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ line-length = 120
[tool.ruff.lint]
select = [
"A",
"ANN",
"ARG",
"B",
"C",
Expand Down Expand Up @@ -113,6 +114,7 @@ select = [
]
ignore = [
# Allow non-abstract empty methods in abstract base classes
"ANN401",
"B027",
# Allow boolean positional values in function calls, like `dict.get(... True)`
"FBT003",
Expand All @@ -136,7 +138,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/**/*" = ["ANN", "PLR2004", "S101", "TID252"]

[tool.coverage.run]
source = ["haystack_integrations"]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,10 @@ def __init__(
separator: str = "\n\n",
unstructured_kwargs: dict[str, Any] | None = None,
progress_bar: bool = True, # noqa: FBT001, FBT002
):
) -> None:
"""
Create an `UnstructuredFileConverter` instance.

:param api_url: URL of the Unstructured API. Defaults to the URL of the hosted version.
If you run the API locally, specify the URL of your local API (e.g. `"http://localhost:8000/general/v0/general"`).
:param api_key: API key for the Unstructured API.
Expand Down
6 changes: 4 additions & 2 deletions integrations/valkey/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ line-length = 120
[tool.ruff.lint]
select = [
"A",
"ANN",
"ARG",
"B",
"C",
Expand Down Expand Up @@ -111,6 +112,7 @@ select = [
]
ignore = [
# Allow non-abstract empty methods in abstract base classes
"ANN401",
"B027",
# Allow boolean positional values in function calls, like `dict.get(... True)`
"FBT003",
Expand Down Expand Up @@ -143,8 +145,8 @@ ban-relative-imports = "parents"

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

[tool.coverage.run]
source = ["haystack_integrations"]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,10 @@ def __init__(
filters: dict[str, Any] | None = None,
top_k: int = 10,
filter_policy: str | FilterPolicy = FilterPolicy.REPLACE,
):
) -> None:
"""
Create a `ValkeyEmbeddingRetriever` instance.

:param document_store: The Valkey Document Store.
:param filters: Filters applied to the retrieved Documents.
:param top_k: Maximum number of Documents to return.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ def __init__(
distance_metric: Literal["l2", "cosine", "ip"] = "cosine",
embedding_dim: int = 768,
metadata_fields: dict[str, type[str] | type[int]] | None = None,
):
) -> None:
"""
Creates a new ValkeyDocumentStore instance.

Expand Down
5 changes: 4 additions & 1 deletion integrations/watsonx/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ line-length = 120
[tool.ruff.lint]
select = [
"A",
"ANN",
"ARG",
"B",
"C",
Expand Down Expand Up @@ -116,6 +117,7 @@ select = [
ignore = [
"T201", # print statements
# Allow non-abstract empty methods in abstract base classes
"ANN401",
"B027",
# Ignore checks for possible passwords
"S105",
Expand Down Expand Up @@ -145,7 +147,8 @@ ban-relative-imports = "parents"

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

[tool.coverage.run]
source = ["haystack_integrations"]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def __init__(
max_retries: int | None = None,
meta_fields_to_embed: list[str] | None = None,
embedding_separator: str = "\n",
):
) -> None:
"""
Creates a WatsonxDocumentEmbedder component.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def __init__(
suffix: str = "",
timeout: float | None = None,
max_retries: int | None = None,
):
) -> None:
"""
Creates an WatsonxTextEmbedder component.

Expand Down
5 changes: 4 additions & 1 deletion integrations/weave/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ line-length = 120
[tool.ruff.lint]
select = [
"A",
"ANN",
"ARG",
"B",
"C",
Expand Down Expand Up @@ -105,6 +106,7 @@ select = [
]
ignore = [
# Allow non-abstract empty methods in abstract base classes
"ANN401",
"B027",
# Allow boolean positional values in function calls, like `dict.get(... True)`
"FBT003",
Expand All @@ -128,7 +130,8 @@ ban-relative-imports = "parents"

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

[tool.coverage.run]
source = ["haystack_integrations"]
Expand Down
4 changes: 3 additions & 1 deletion integrations/weaviate/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 @@ -112,6 +113,7 @@ select = [
]
ignore = [
# Allow non-abstract empty methods in abstract base classes
"ANN401",
"B027",
# Allow boolean positional values in function calls, like `dict.get(... True)`
"FBT003",
Expand All @@ -135,7 +137,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/**/*" = ["ANN", "PLR2004", "S101", "TID252"]

[tool.coverage.run]
source = ["haystack_integrations"]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def __init__(
filters: dict[str, Any] | None = None,
top_k: int = 10,
filter_policy: str | FilterPolicy = FilterPolicy.REPLACE,
):
) -> None:
"""
Create a new instance of WeaviateBM25Retriever.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def __init__(
distance: float | None = None,
certainty: float | None = None,
filter_policy: str | FilterPolicy = FilterPolicy.REPLACE,
):
) -> None:
"""
Creates a new instance of WeaviateEmbeddingRetriever.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def __init__(
alpha: float = 0.7,
max_vector_distance: float | None = None,
filter_policy: str | FilterPolicy = FilterPolicy.REPLACE,
):
) -> None:
"""
Creates a new instance of WeaviateHybridRetriever.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class SupportedAuthTypes(Enum):
CLIENT_CREDENTIALS = "client_credentials"
CLIENT_PASSWORD = "client_password"

def __str__(self):
def __str__(self) -> str:
return self.value

@staticmethod
Expand Down Expand Up @@ -87,7 +87,9 @@ def _from_dict(cls, data: dict[str, Any]) -> "AuthCredentials":
"""

@abstractmethod
def resolve_value(self):
def resolve_value(
self,
) -> WeaviateAuthApiKey | WeaviateAuthBearerToken | WeaviateAuthClientCredentials | WeaviateAuthClientPassword:
"""
Resolves all the secrets in the auth credentials object and returns the corresponding Weaviate object.
All subclasses must implement this method.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ def __init__(
}
self._clean_connection_settings()

def _clean_connection_settings(self):
def _clean_connection_settings(self) -> None:
# Set the class if not set
_class_name = self._collection_settings.get("class", "Default")
_class_name = _class_name[0].upper() + _class_name[1:]
Expand All @@ -184,7 +184,7 @@ def _clean_connection_settings(self):
)

@property
def client(self):
def client(self) -> weaviate.WeaviateClient:
if self._client:
return self._client

Expand Down Expand Up @@ -228,7 +228,7 @@ def client(self):
return self._client

@property
async def async_client(self):
async def async_client(self) -> weaviate.WeaviateAsyncClient:
if self._async_client:
return self._async_client

Expand Down
Loading