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
9 changes: 8 additions & 1 deletion integrations/stackit/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,13 @@ select = [
"ARG",
"B",
"C",
"D102", # Missing docstring in public method
"D103", # Missing docstring in public function
"D205", # 1 blank line required between summary line and description
"D209", # Closing triple quotes go to new line
"D213", # summary lines must be positioned on the second physical line of the docstring
"D417", # Missing argument descriptions in the docstring
"D419", # Docstring is empty
"DTZ",
"E",
"EM",
Expand Down Expand Up @@ -132,7 +139,7 @@ ban-relative-imports = "parents"

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

[tool.coverage.run]
source = ["haystack_integrations"]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
class STACKITDocumentEmbedder(OpenAIDocumentEmbedder):
"""
A component for computing Document embeddings using STACKIT as model provider.

The embedding of each Document is stored in the `embedding` field of the Document.

Usage example:
Expand Down Expand Up @@ -110,6 +111,7 @@ def __init__(
def to_dict(self) -> dict[str, Any]:
"""
Serializes the component to a dictionary.

:returns:
Dictionary with serialized data.
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ def __init__(
def to_dict(self) -> dict[str, Any]:
"""
Serializes the component to a dictionary.

:returns:
Dictionary with serialized data.
"""
Expand Down
13 changes: 10 additions & 3 deletions integrations/togetherai/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,13 @@ select = [
"ARG",
"B",
"C",
"D102", # Missing docstring in public method
"D103", # Missing docstring in public function
"D205", # 1 blank line required between summary line and description
"D209", # Closing triple quotes go to new line
"D213", # summary lines must be positioned on the second physical line of the docstring
"D417", # Missing argument descriptions in the docstring
"D419", # Docstring is empty
"DTZ",
"E",
"EM",
Expand Down Expand Up @@ -136,10 +143,10 @@ ban-relative-imports = "parents"

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


[tool.coverage.run]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
class TogetherAIChatGenerator(OpenAIChatGenerator):
"""
Enables text generation using Together AI generative models.

For supported models, see [Together AI docs](https://docs.together.ai/docs).

Users can pass any text generation parameters valid for the Together AI chat completion API
Expand Down Expand Up @@ -72,8 +73,7 @@ def __init__(
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`.
Creates an instance of TogetherAIChatGenerator.

:param api_key:
The Together API key.
Expand Down
9 changes: 8 additions & 1 deletion integrations/unstructured/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,13 @@ select = [
"ARG",
"B",
"C",
"D102", # Missing docstring in public method
"D103", # Missing docstring in public function
"D205", # 1 blank line required between summary line and description
"D209", # Closing triple quotes go to new line
"D213", # summary lines must be positioned on the second physical line of the docstring
"D417", # Missing argument descriptions in the docstring
"D419", # Docstring is empty
"DTZ",
"E",
"EM",
Expand Down Expand Up @@ -139,7 +146,7 @@ ban-relative-imports = "parents"

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

[tool.coverage.run]
source = ["haystack_integrations"]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ def to_dict(self) -> dict[str, Any]:
def from_dict(cls, data: dict[str, Any]) -> "UnstructuredFileConverter":
"""
Deserializes the component from a dictionary.

:param data:
Dictionary to deserialize from.
:returns:
Expand Down
11 changes: 9 additions & 2 deletions integrations/valkey/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,13 @@ select = [
"ARG",
"B",
"C",
"D102", # Missing docstring in public method
"D103", # Missing docstring in public function
"D205", # 1 blank line required between summary line and description
"D209", # Closing triple quotes go to new line
"D213", # summary lines must be positioned on the second physical line of the docstring
"D417", # Missing argument descriptions in the docstring
"D419", # Docstring is empty
"DTZ",
"E",
"EM",
Expand Down Expand Up @@ -145,8 +152,8 @@ ban-relative-imports = "parents"

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

[tool.coverage.run]
source = ["haystack_integrations"]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ def __init__(
def to_dict(self) -> dict[str, Any]:
"""
Serializes the component to a dictionary.

:returns:
Dictionary with serialized data.
"""
Expand All @@ -106,6 +107,7 @@ def to_dict(self) -> dict[str, Any]:
def from_dict(cls, data: dict[str, Any]) -> "ValkeyEmbeddingRetriever":
"""
Deserializes the component from a dictionary.

:param data:
Dictionary to deserialize from.
:returns:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,7 @@ async def _get_connection_async(self) -> GlideClient | GlideClusterClient:
raise ValkeyDocumentStoreError(msg) from e

def close(self) -> None:
"""Close the synchronous Valkey client connection."""
if self._client:
try:
self._client.close()
Expand All @@ -289,6 +290,7 @@ def close(self) -> None:
self._client = None

async def close_async(self) -> None:
"""Close the asynchronous Valkey client connection."""
if self._async_client:
try:
await self._async_client.close()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
#
# SPDX-License-Identifier: Apache-2.0

"""Valkey document store filtering utilities.
"""
Valkey document store filtering utilities.

This module provides filter conversion from Haystack's filter format to Valkey Search query syntax.
It supports both tag-based exact matching and numeric range filtering with logical operators.
Expand Down
11 changes: 9 additions & 2 deletions integrations/watsonx/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,13 @@ select = [
"ARG",
"B",
"C",
"D102", # Missing docstring in public method
"D103", # Missing docstring in public function
"D205", # 1 blank line required between summary line and description
"D209", # Closing triple quotes go to new line
"D213", # summary lines must be positioned on the second physical line of the docstring
"D417", # Missing argument descriptions in the docstring
"D419", # Docstring is empty
"DTZ",
"E",
"EM",
Expand Down Expand Up @@ -147,8 +154,8 @@ ban-relative-imports = "parents"

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

[tool.coverage.run]
source = ["haystack_integrations"]
Expand Down
11 changes: 9 additions & 2 deletions integrations/weave/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,13 @@ select = [
"ARG",
"B",
"C",
"D102", # Missing docstring in public method
"D103", # Missing docstring in public function
"D205", # 1 blank line required between summary line and description
"D209", # Closing triple quotes go to new line
"D213", # summary lines must be positioned on the second physical line of the docstring
"D417", # Missing argument descriptions in the docstring
"D419", # Docstring is empty
"DTZ",
"E",
"EM",
Expand Down Expand Up @@ -131,8 +138,8 @@ ban-relative-imports = "parents"

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

[tool.coverage.run]
source = ["haystack_integrations"]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ def warm_up(self) -> None:

@component.output_types(pipeline_name=str)
def run(self) -> dict[str, str]:
"""Run the WeaveConnector, initializing the tracer if needed."""
if self.tracer is None:
self.warm_up()
# NOTE: this is a no-op component - it simply triggers the Tracer to sends traces to Weights & Biases
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ def set_tag(self, key: str, value: Any) -> None:
self._attributes[key] = value

def set_tags(self, tags: dict[str, Any]) -> None:
"""Set multiple tags at once by iterating over the provided dictionary."""
for k, v in tags.items():
self.set_tag(k, v)

Expand All @@ -56,9 +57,11 @@ def get_correlation_data_for_logs(self) -> dict[str, Any]:
return {"weave.call_id": self._call.id, "weave.run_id": getattr(self._call, "run_id", "")}

def set_call(self, call: Call) -> None:
"""Set the underlying Weave Call object for this span."""
self._call = call

def get_attributes(self) -> dict[str, Any]:
"""Return the accumulated attributes dictionary for this span."""
return self._attributes


Expand Down Expand Up @@ -92,6 +95,7 @@ def __init__(self, project_name: str, **weave_init_kwargs: Any) -> None:

@staticmethod
def create_call(attributes: dict, client: WeaveClient, parent_span: WeaveSpan | None, operation_name: str) -> Call:
"""Create and return a Weave Call from the given span attributes and client."""
comp_name = attributes.pop("haystack.component.name", "")
comp_type = attributes.pop("haystack.component.type", "")
comp_input = attributes.pop("haystack.component.input", {})
Expand Down
9 changes: 8 additions & 1 deletion integrations/weaviate/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,13 @@ select = [
"ARG",
"B",
"C",
"D102", # Missing docstring in public method
"D103", # Missing docstring in public function
"D205", # 1 blank line required between summary line and description
"D209", # Closing triple quotes go to new line
"D213", # summary lines must be positioned on the second physical line of the docstring
"D417", # Missing argument descriptions in the docstring
"D419", # Docstring is empty
"DTZ",
"E",
"EM",
Expand Down Expand Up @@ -138,7 +145,7 @@ ban-relative-imports = "parents"

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

[tool.coverage.run]
source = ["haystack_integrations"]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ def convert_filters(filters: dict[str, Any]) -> FilterReturn:
def _invert_condition(filters: dict[str, Any]) -> dict[str, Any]:
"""
Invert condition recursively.

Weaviate doesn't support NOT filters so we need to invert them ourselves.
"""
inverted_condition = filters.copy()
Expand Down Expand Up @@ -286,8 +287,9 @@ def _parse_comparison_condition(condition: dict[str, Any]) -> FilterReturn:

def _match_no_document(field: str) -> FilterReturn:
"""
Returns a filters that will match no Document, this is used to keep the behavior consistent
between different Document Stores.
Returns a filter that will match no Document.

This is used to keep the behavior consistent between different Document Stores.
"""

operands = [weaviate.classes.query.Filter.by_property(field).is_none(val) for val in [False, True]]
Expand Down
Loading
Loading