Skip to content

Commit 07b26a8

Browse files
julian-rischclaude
andauthored
chore: add ANN type annotations to stackit, togetherai, unstructured, valkey, watsonx, weave, weaviate (#2994)
* chore: add ANN type annotations to stackit, togetherai, unstructured, valkey, watsonx, weave, weaviate Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * chore: add opening sentence to __init__ docstrings in unstructured and valkey Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 402210b commit 07b26a8

22 files changed

Lines changed: 49 additions & 26 deletions

File tree

integrations/stackit/pyproject.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ line-length = 120
7979
[tool.ruff.lint]
8080
select = [
8181
"A",
82+
"ANN",
8283
"ARG",
8384
"B",
8485
"C",
@@ -105,6 +106,7 @@ select = [
105106
]
106107
ignore = [
107108
# Allow non-abstract empty methods in abstract base classes
109+
"ANN401",
108110
"B027",
109111
# Ignore checks for possible passwords
110112
"S105",
@@ -129,7 +131,7 @@ ban-relative-imports = "parents"
129131

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

134136
[tool.coverage.run]
135137
source = ["haystack_integrations"]

integrations/stackit/src/haystack_integrations/components/embedders/stackit/document_embedder.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ def __init__(
5353
timeout: float | None = None,
5454
max_retries: int | None = None,
5555
http_client_kwargs: dict[str, Any] | None = None,
56-
):
56+
) -> None:
5757
"""
5858
Creates a STACKITDocumentEmbedder component.
5959

integrations/stackit/src/haystack_integrations/components/embedders/stackit/text_embedder.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ def __init__(
4242
timeout: float | None = None,
4343
max_retries: int | None = None,
4444
http_client_kwargs: dict[str, Any] | None = None,
45-
):
45+
) -> None:
4646
"""
4747
Creates a STACKITTextEmbedder component.
4848

integrations/stackit/src/haystack_integrations/components/generators/stackit/chat/chat_generator.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ def __init__(
6262
timeout: float | None = None,
6363
max_retries: int | None = None,
6464
http_client_kwargs: dict[str, Any] | None = None,
65-
):
65+
) -> None:
6666
"""
6767
Creates an instance of STACKITChatGenerator class.
6868

integrations/togetherai/pyproject.toml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ line-length = 120
8686
[tool.ruff.lint]
8787
select = [
8888
"A",
89+
"ANN",
8990
"ARG",
9091
"B",
9192
"C",
@@ -112,6 +113,7 @@ select = [
112113
]
113114
ignore = [
114115
# Allow non-abstract empty methods in abstract base classes
116+
"ANN401",
115117
"B027",
116118
# Ignore checks for possible passwords
117119
"S105",
@@ -133,7 +135,8 @@ ban-relative-imports = "parents"
133135

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

integrations/togetherai/src/haystack_integrations/components/generators/togetherai/chat/chat_generator.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ def __init__(
7070
timeout: float | None = None,
7171
max_retries: int | None = None,
7272
http_client_kwargs: dict[str, Any] | None = None,
73-
):
73+
) -> None:
7474
"""
7575
Creates an instance of TogetherAIChatGenerator. Unless specified otherwise,
7676
the default model is `meta-llama/Llama-3.3-70B-Instruct-Turbo`.

integrations/togetherai/src/haystack_integrations/components/generators/togetherai/generator.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ def __init__(
4141
generation_kwargs: dict[str, Any] | None = None,
4242
timeout: float | None = None,
4343
max_retries: int | None = None,
44-
):
44+
) -> None:
4545
"""
4646
Initialize the TogetherAIGenerator.
4747

integrations/unstructured/pyproject.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ line-length = 120
8686
[tool.ruff.lint]
8787
select = [
8888
"A",
89+
"ANN",
8990
"ARG",
9091
"B",
9192
"C",
@@ -113,6 +114,7 @@ select = [
113114
]
114115
ignore = [
115116
# Allow non-abstract empty methods in abstract base classes
117+
"ANN401",
116118
"B027",
117119
# Allow boolean positional values in function calls, like `dict.get(... True)`
118120
"FBT003",
@@ -136,7 +138,7 @@ ban-relative-imports = "parents"
136138

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

141143
[tool.coverage.run]
142144
source = ["haystack_integrations"]

integrations/unstructured/src/haystack_integrations/components/converters/unstructured/converter.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,10 @@ def __init__(
5454
separator: str = "\n\n",
5555
unstructured_kwargs: dict[str, Any] | None = None,
5656
progress_bar: bool = True, # noqa: FBT001, FBT002
57-
):
57+
) -> None:
5858
"""
59+
Create an `UnstructuredFileConverter` instance.
60+
5961
:param api_url: URL of the Unstructured API. Defaults to the URL of the hosted version.
6062
If you run the API locally, specify the URL of your local API (e.g. `"http://localhost:8000/general/v0/general"`).
6163
:param api_key: API key for the Unstructured API.

integrations/valkey/pyproject.toml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ line-length = 120
8484
[tool.ruff.lint]
8585
select = [
8686
"A",
87+
"ANN",
8788
"ARG",
8889
"B",
8990
"C",
@@ -111,6 +112,7 @@ select = [
111112
]
112113
ignore = [
113114
# Allow non-abstract empty methods in abstract base classes
115+
"ANN401",
114116
"B027",
115117
# Allow boolean positional values in function calls, like `dict.get(... True)`
116118
"FBT003",
@@ -143,8 +145,8 @@ ban-relative-imports = "parents"
143145

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

149151
[tool.coverage.run]
150152
source = ["haystack_integrations"]

0 commit comments

Comments
 (0)