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/faiss/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 @@ -133,6 +134,8 @@ ignore = [
"ARG002",
# Allow assertions
"S101",
# Allow `Any` - used legitimately for dynamic types and SDK boundaries
"ANN401",
]
exclude = ["example"]

Expand All @@ -144,7 +147,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 @@ -59,7 +59,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 `FAISSDocumentStore`.
:param filters: Filters applied to the retrieved Documents at initialisation time. At runtime, these are merged
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def __init__(
index_path: str | None = None,
index_string: str = "Flat",
embedding_dim: int = 768,
):
) -> None:
"""
Initializes the FAISSDocumentStore.

Expand All @@ -61,7 +61,7 @@ def __init__(
else:
self._create_new_index()

def _create_new_index(self):
def _create_new_index(self) -> None:
"""Creates a new FAISS index."""
try:
# We use IndexIDMap to support add_with_ids
Expand Down
5 changes: 4 additions & 1 deletion integrations/fastembed/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 Down Expand Up @@ -115,6 +116,8 @@ ignore = [
"S105",
"S106",
"S107",
# Allow `Any` - used legitimately for dynamic types and SDK boundaries
"ANN401",
# Ignore complexity
"C901",
"PLR0911",
Expand All @@ -131,7 +134,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"]
# examples can contain "print" commands
"examples/**/*" = ["T201", "E501"]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def __init__(
cache_dir: str | None = None,
threads: int | None = None,
local_files_only: bool = False,
):
) -> None:
self.model = TextEmbedding(
model_name=model_name, cache_dir=cache_dir, threads=threads, local_files_only=local_files_only
)
Expand Down Expand Up @@ -103,7 +103,7 @@ def __init__(
threads: int | None = None,
local_files_only: bool = False,
model_kwargs: dict[str, Any] | None = None,
):
) -> None:
model_kwargs = model_kwargs or {}

self.model = SparseTextEmbedding(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def __init__(
local_files_only: bool = False,
meta_fields_to_embed: list[str] | None = None,
meta_data_separator: str = "\n",
):
) -> None:
"""
Creates an instance of the 'FastembedRanker'.

Expand Down Expand Up @@ -114,7 +114,7 @@ def from_dict(cls, data: dict[str, Any]) -> "FastembedRanker":
"""
return default_from_dict(cls, data)

def warm_up(self):
def warm_up(self) -> None:
"""
Initializes the component.
"""
Expand Down
5 changes: 4 additions & 1 deletion integrations/firecrawl/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ line-length = 120
[tool.ruff.lint]
select = [
"A",
"ANN",
"ARG",
"B",
"C",
Expand Down Expand Up @@ -123,6 +124,8 @@ ignore = [
"S105",
"S106",
"S107",
# Allow `Any` - used legitimately for dynamic types and SDK boundaries
"ANN401",
# Ignore complexity
"C901",
"PLR0911",
Expand All @@ -143,7 +146,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"]

[tool.coverage.run]
source = ["haystack_integrations"]
Expand Down
5 changes: 4 additions & 1 deletion integrations/github/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ line-length = 120
[tool.ruff.lint]
select = [
"A",
"ANN",
"ARG",
"B",
"C",
Expand Down Expand Up @@ -121,6 +122,8 @@ ignore = [
# Misc
"B008",
"S101",
# Allow `Any` - used legitimately for dynamic types and SDK boundaries
"ANN401",
]

[tool.ruff.lint.isort]
Expand All @@ -131,7 +134,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"]
# Ignore RUF001 for all files in the prompts directory
"src/haystack_integrations/components/prompts/**/*" = ["RUF001"]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def __init__(
repo: str | None = None,
branch: str = "main",
raise_on_failure: bool = True,
):
) -> None:
"""
Initialize the component.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def __init__(
github_token: Secret = Secret.from_env_var("GITHUB_TOKEN"),
raise_on_failure: bool = True,
retry_attempts: int = 2,
):
) -> None:
"""
Initialize the component.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def __init__(
github_token: Secret | None = None,
raise_on_failure: bool = True,
retry_attempts: int = 2,
):
) -> None:
"""
Initialize the component.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,12 @@ class GitHubPRCreator:
```
"""

def __init__(self, *, github_token: Secret = Secret.from_env_var("GITHUB_TOKEN"), raise_on_failure: bool = True):
def __init__(
self,
*,
github_token: Secret = Secret.from_env_var("GITHUB_TOKEN"),
raise_on_failure: bool = True,
) -> None:
"""
Initialize the component.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def __init__(
poll_interval: int = 2,
auto_sync: bool = True,
create_branch: bool = True,
):
) -> None:
"""
Initialize the component.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def __init__(
max_file_size: int = 1_000_000, # 1MB default limit
repo: str | None = None,
branch: str = "main",
):
) -> None:
"""
Initialize the component.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def __init__(
outputs_to_string: dict[str, str | Callable[[Any], str]] | None = None,
inputs_from_state: dict[str, str] | None = None,
outputs_to_state: dict[str, dict[str, str | Callable]] | None = None,
):
) -> None:
"""
Initialize the GitHub file editor tool.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def __init__(
outputs_to_string: dict[str, str | Callable[[Any], str]] | None = None,
inputs_from_state: dict[str, str] | None = None,
outputs_to_state: dict[str, dict[str, str | Callable]] | None = None,
):
) -> None:
"""
Initialize the GitHub issue commenter tool.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def __init__(
outputs_to_string: dict[str, str | Callable[[Any], str]] | None = None,
inputs_from_state: dict[str, str] | None = None,
outputs_to_state: dict[str, dict[str, str | Callable]] | None = None,
):
) -> None:
"""
Initialize the GitHub issue viewer tool.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def __init__(
outputs_to_string: dict[str, str | Callable[[Any], str]] | None = None,
inputs_from_state: dict[str, str] | None = None,
outputs_to_state: dict[str, dict[str, str | Callable]] | None = None,
):
) -> None:
"""
Initialize the GitHub PR creator tool.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def __init__(
outputs_to_string: dict[str, str | Callable[[Any], str]] | None = None,
inputs_from_state: dict[str, str] | None = None,
outputs_to_state: dict[str, dict[str, str | Callable]] | None = None,
):
) -> None:
"""
Initialize the GitHub Repo Forker tool.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def __init__(
outputs_to_string: dict[str, str | Callable[[Any], str]] | None = None,
inputs_from_state: dict[str, str] | None = None,
outputs_to_state: dict[str, dict[str, str | Callable]] | None = None,
):
) -> None:
"""
Initialize the GitHub repository viewer tool.

Expand Down
5 changes: 4 additions & 1 deletion integrations/google_ai/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ line-length = 120
[tool.ruff.lint]
select = [
"A",
"ANN",
"ARG",
"B",
"C",
Expand Down Expand Up @@ -121,6 +122,8 @@ ignore = [
"S105",
"S106",
"S107",
# Allow `Any` - used legitimately for dynamic types and SDK boundaries
"ANN401",
# Ignore complexity
"C901",
"PLR0911",
Expand All @@ -141,7 +144,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"]

[tool.coverage.run]
source = ["haystack_integrations"]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ def __init__(
tools: Optional[list[Tool]] = None,
tool_config: Optional[content_types.ToolConfigDict] = None,
streaming_callback: Optional[StreamingCallbackT] = None,
):
) -> None:
"""
Initializes a `GoogleAIGeminiChatGenerator` instance.

Expand Down Expand Up @@ -262,7 +262,7 @@ def run(
streaming_callback: Optional[StreamingCallbackT] = None,
*,
tools: Optional[list[Tool]] = None,
):
) -> dict[str, list[ChatMessage]]:
"""
Generates text based on the provided messages.

Expand Down Expand Up @@ -315,7 +315,7 @@ async def run_async(
streaming_callback: Optional[StreamingCallbackT] = None,
*,
tools: Optional[list[Tool]] = None,
):
) -> dict[str, list[ChatMessage]]:
"""
Async version of the run method. Generates text based on the provided messages.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ class GoogleAIGeminiGenerator:
```
"""

def __new__(cls, *_, **kwargs):
def __new__(cls, *_: Any, **kwargs: Any) -> "GoogleAIGeminiGenerator":
if "tools" in kwargs:
msg = (
"GoogleAIGeminiGenerator does not support the `tools` parameter. "
Expand All @@ -80,7 +80,7 @@ def __init__(
generation_config: Optional[Union[GenerationConfig, dict[str, Any]]] = None,
safety_settings: Optional[dict[HarmCategory, HarmBlockThreshold]] = None,
streaming_callback: Optional[Callable[[StreamingChunk], None]] = None,
):
) -> None:
"""
Initializes a `GoogleAIGeminiGenerator` instance.

Expand Down Expand Up @@ -185,7 +185,7 @@ def run(
self,
parts: Variadic[Union[str, ByteStream, Part]],
streaming_callback: Optional[Callable[[StreamingChunk], None]] = None,
):
) -> dict[str, list[str]]:
"""
Generates text based on the given input parts.

Expand Down
Loading