weave-haystack 3.1.0__tar.gz → 4.0.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (19) hide show
  1. weave_haystack-4.0.0/CHANGELOG.md +42 -0
  2. {weave_haystack-3.1.0 → weave_haystack-4.0.0}/PKG-INFO +5 -4
  3. {weave_haystack-3.1.0 → weave_haystack-4.0.0}/example/hybrid_retrieval.py +7 -4
  4. weave_haystack-4.0.0/pydoc/config_docusaurus.yml +14 -0
  5. {weave_haystack-3.1.0 → weave_haystack-4.0.0}/pyproject.toml +19 -5
  6. {weave_haystack-3.1.0 → weave_haystack-4.0.0}/src/haystack_integrations/components/connectors/weave/weave_connector.py +7 -1
  7. {weave_haystack-3.1.0 → weave_haystack-4.0.0}/src/haystack_integrations/tracing/weave/tracer.py +4 -0
  8. {weave_haystack-3.1.0 → weave_haystack-4.0.0}/tests/test_weave_connector.py +2 -4
  9. weave_haystack-3.1.0/CHANGELOG.md +0 -9
  10. weave_haystack-3.1.0/pydoc/config_docusaurus.yml +0 -29
  11. {weave_haystack-3.1.0 → weave_haystack-4.0.0}/.gitignore +0 -0
  12. {weave_haystack-3.1.0 → weave_haystack-4.0.0}/LICENSE.txt +0 -0
  13. {weave_haystack-3.1.0 → weave_haystack-4.0.0}/README.md +0 -0
  14. {weave_haystack-3.1.0 → weave_haystack-4.0.0}/example/README.md +0 -0
  15. {weave_haystack-3.1.0 → weave_haystack-4.0.0}/src/haystack_integrations/components/connectors/py.typed +0 -0
  16. {weave_haystack-3.1.0 → weave_haystack-4.0.0}/src/haystack_integrations/components/connectors/weave/__init__.py +0 -0
  17. {weave_haystack-3.1.0 → weave_haystack-4.0.0}/src/haystack_integrations/tracing/py.typed +0 -0
  18. {weave_haystack-3.1.0 → weave_haystack-4.0.0}/src/haystack_integrations/tracing/weave/__init__.py +0 -0
  19. {weave_haystack-3.1.0 → weave_haystack-4.0.0}/tests/test_tracer.py +0 -0
@@ -0,0 +1,42 @@
1
+ # Changelog
2
+
3
+ ## [integrations/weave-v3.2.0] - 2026-05-15
4
+
5
+ ### 🐛 Bug Fixes
6
+
7
+ - Adaptations for changes in Weave settings (#3304)
8
+
9
+ ### 📚 Documentation
10
+
11
+ - Simplify pydoc configs (#2855)
12
+ - *(weave)* Remove explicit warm_up calls (#2856)
13
+
14
+ ### 🧪 Testing
15
+
16
+ - Test compatible integrations with python 3.14; update pyproject (#3001)
17
+ - Track test coverage for all integrations (#3065)
18
+
19
+ ### 🧹 Chores
20
+
21
+ - Add ANN type annotations to stackit, togetherai, unstructured, valkey, watsonx, weave, weaviate (#2994)
22
+ - Enforce ruff docstring rules (D102/D103/D205/D209/D213/D417/D419) in integrations 41-47 (#3012)
23
+
24
+
25
+ ## [integrations/weave-v3.1.0] - 2026-01-14
26
+
27
+ ### 🚀 Features
28
+
29
+ - Update weave components to auto call run `warm_up` (#2750)
30
+
31
+ ### 🧹 Chores
32
+
33
+ - Standardize Weave integration - pt.2 (#2739)
34
+
35
+
36
+ ## [integrations/weave-v3.0.0] - 2026-01-13
37
+
38
+ ### 🧹 Chores
39
+
40
+ - Standardize Weave integration (#2738)
41
+
42
+ <!-- generated by git-cliff -->
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.4
1
+ Metadata-Version: 2.5
2
2
  Name: weave-haystack
3
- Version: 3.1.0
3
+ Version: 4.0.0
4
4
  Summary: An integration of Weights & Biases Weave tracer with Haystack
5
5
  Project-URL: Source, https://github.com/deepset-ai/haystack-core-integrations
6
6
  Project-URL: Documentation, https://github.com/deepset-ai/haystack-core-integrations/blob/main/integrations/weave/README.md
@@ -11,13 +11,14 @@ License-File: LICENSE.txt
11
11
  Classifier: Development Status :: 4 - Beta
12
12
  Classifier: License :: OSI Approved :: Apache Software License
13
13
  Classifier: Programming Language :: Python
14
- Classifier: Programming Language :: Python :: 3.10
15
14
  Classifier: Programming Language :: Python :: 3.11
16
15
  Classifier: Programming Language :: Python :: 3.12
17
16
  Classifier: Programming Language :: Python :: 3.13
17
+ Classifier: Programming Language :: Python :: 3.14
18
+ Classifier: Programming Language :: Python :: 3.15
18
19
  Classifier: Programming Language :: Python :: Implementation :: CPython
19
20
  Classifier: Programming Language :: Python :: Implementation :: PyPy
20
- Requires-Python: >=3.10
21
+ Requires-Python: >=3.11
21
22
  Requires-Dist: haystack-ai>=2.22.0
22
23
  Requires-Dist: weave>=0.52.7
23
24
  Description-Content-Type: text/markdown
@@ -1,11 +1,14 @@
1
1
  from haystack import Document, Pipeline
2
- from haystack.components.embedders import SentenceTransformersDocumentEmbedder, SentenceTransformersTextEmbedder
3
2
  from haystack.components.joiners import DocumentJoiner
4
- from haystack.components.rankers import TransformersSimilarityRanker
5
3
  from haystack.components.retrievers.in_memory import InMemoryBM25Retriever, InMemoryEmbeddingRetriever
6
4
  from haystack.document_stores.in_memory import InMemoryDocumentStore
7
5
 
8
6
  from haystack_integrations.components.connectors.weave import WeaveConnector
7
+ from haystack_integrations.components.embedders.sentence_transformers import (
8
+ SentenceTransformersDocumentEmbedder,
9
+ SentenceTransformersTextEmbedder,
10
+ )
11
+ from haystack_integrations.components.rankers.sentence_transformers import SentenceTransformersSimilarityRanker
9
12
 
10
13
 
11
14
  def index():
@@ -20,7 +23,7 @@ def index():
20
23
  ]
21
24
 
22
25
  embedder = SentenceTransformersDocumentEmbedder()
23
- embedder.warm_up()
26
+ # Components warm up automatically on first run.
24
27
  embed_docs = embedder.run(documents)
25
28
 
26
29
  document_store.write_documents(embed_docs["documents"])
@@ -33,7 +36,7 @@ def hybrid_pipeline(document_store):
33
36
  embedding_retriever = InMemoryEmbeddingRetriever(document_store)
34
37
  bm25_retriever = InMemoryBM25Retriever(document_store)
35
38
  document_joiner = DocumentJoiner()
36
- ranker = TransformersSimilarityRanker(model="BAAI/bge-reranker-base")
39
+ ranker = SentenceTransformersSimilarityRanker(model="BAAI/bge-reranker-base")
37
40
 
38
41
  hybrid_retrieval = Pipeline()
39
42
  hybrid_retrieval.add_component("text_embedder", text_embedder)
@@ -0,0 +1,14 @@
1
+ loaders:
2
+ - modules:
3
+ - haystack_integrations.components.connectors.weave.weave_connector
4
+ - haystack_integrations.tracing.weave.tracer
5
+ search_path: [../src]
6
+ processors:
7
+ - type: filter
8
+ documented_only: true
9
+ skip_empty_modules: true
10
+ renderer:
11
+ description: Weights & Bias integration for Haystack
12
+ id: integrations-weave
13
+ filename: weave.md
14
+ title: Weave
@@ -7,7 +7,7 @@ name = "weave-haystack"
7
7
  dynamic = ["version"]
8
8
  description = "An integration of Weights & Biases Weave tracer with Haystack"
9
9
  readme = "README.md"
10
- requires-python = ">=3.10"
10
+ requires-python = ">=3.11"
11
11
  license = "Apache-2.0"
12
12
  keywords = []
13
13
  authors = [{ name = "deepset GmbH", email = "info@deepset.ai" }]
@@ -15,10 +15,11 @@ classifiers = [
15
15
  "License :: OSI Approved :: Apache Software License",
16
16
  "Development Status :: 4 - Beta",
17
17
  "Programming Language :: Python",
18
- "Programming Language :: Python :: 3.10",
19
18
  "Programming Language :: Python :: 3.11",
20
19
  "Programming Language :: Python :: 3.12",
21
20
  "Programming Language :: Python :: 3.13",
21
+ "Programming Language :: Python :: 3.14",
22
+ "Programming Language :: Python :: 3.15",
22
23
  "Programming Language :: Python :: Implementation :: CPython",
23
24
  "Programming Language :: Python :: Implementation :: PyPy",
24
25
  ]
@@ -44,7 +45,7 @@ git_describe_command = 'git describe --tags --match="integrations/weave-v[0-9]*"
44
45
  installer = "uv"
45
46
  dependencies = ["haystack-pydoc-tools", "ruff"]
46
47
  [tool.hatch.envs.default.scripts]
47
- docs = ["pydoc-markdown pydoc/config_docusaurus.yml"]
48
+ docs = ["haystack-pydoc pydoc/config_docusaurus.yml"]
48
49
  fmt = "ruff check --fix {args}; ruff format {args}"
49
50
  fmt-check = "ruff check {args} && ruff format --check {args}"
50
51
 
@@ -62,7 +63,8 @@ dependencies = [
62
63
  unit = 'pytest -m "not integration" {args:tests}'
63
64
  integration = 'pytest -m "integration" {args:tests}'
64
65
  all = 'pytest {args:tests}'
65
- cov-retry = 'pytest --cov=haystack_integrations --reruns 3 --reruns-delay 30 -x {args:tests}'
66
+ unit-cov-retry = 'pytest --cov=haystack_integrations --reruns 3 --reruns-delay 30 -x -m "not integration" {args:tests}'
67
+ integration-cov-append-retry = 'pytest --cov=haystack_integrations --cov-append --reruns 3 --reruns-delay 30 -x -m "integration" {args:tests}'
66
68
  types = """mypy -p haystack_integrations.components.connectors.weave \
67
69
  -p haystack_integrations.tracing.weave {args}"""
68
70
 
@@ -78,9 +80,17 @@ line-length = 120
78
80
  [tool.ruff.lint]
79
81
  select = [
80
82
  "A",
83
+ "ANN",
81
84
  "ARG",
82
85
  "B",
83
86
  "C",
87
+ "D102", # Missing docstring in public method
88
+ "D103", # Missing docstring in public function
89
+ "D205", # 1 blank line required between summary line and description
90
+ "D209", # Closing triple quotes go to new line
91
+ "D213", # summary lines must be positioned on the second physical line of the docstring
92
+ "D417", # Missing argument descriptions in the docstring
93
+ "D419", # Docstring is empty
84
94
  "DTZ",
85
95
  "E",
86
96
  "EM",
@@ -105,6 +115,7 @@ select = [
105
115
  ]
106
116
  ignore = [
107
117
  # Allow non-abstract empty methods in abstract base classes
118
+ "ANN401",
108
119
  "B027",
109
120
  # Allow boolean positional values in function calls, like `dict.get(... True)`
110
121
  "FBT003",
@@ -118,6 +129,7 @@ ignore = [
118
129
  "PLR0912",
119
130
  "PLR0913",
120
131
  "PLR0915",
132
+ "PLR0917",
121
133
  ]
122
134
 
123
135
  [tool.ruff.lint.isort]
@@ -128,11 +140,13 @@ ban-relative-imports = "parents"
128
140
 
129
141
  [tool.ruff.lint.per-file-ignores]
130
142
  # Tests can use magic values, assertions, and relative imports
131
- "tests/**/*" = ["PLR2004", "S101", "TID252"]
143
+ "example/**/*" = ["D", "ANN"]
144
+ "tests/**/*" = ["D", "ANN", "PLR2004", "S101", "TID252"]
132
145
 
133
146
  [tool.coverage.run]
134
147
  source = ["haystack_integrations"]
135
148
  branch = true
149
+ relative_files = true
136
150
  parallel = false
137
151
 
138
152
 
@@ -2,9 +2,11 @@
2
2
  #
3
3
  # SPDX-License-Identifier: Apache-2.0
4
4
 
5
+ from dataclasses import asdict, is_dataclass
5
6
  from typing import Any
6
7
 
7
8
  from haystack import component, default_from_dict, default_to_dict, logging, tracing
9
+ from pydantic import BaseModel
8
10
 
9
11
  from haystack_integrations.tracing.weave import WeaveTracer
10
12
  from weave.trace.settings import UserSettings
@@ -94,6 +96,7 @@ class WeaveConnector:
94
96
 
95
97
  @component.output_types(pipeline_name=str)
96
98
  def run(self) -> dict[str, str]:
99
+ """Run the WeaveConnector, initializing the tracer if needed."""
97
100
  if self.tracer is None:
98
101
  self.warm_up()
99
102
  # NOTE: this is a no-op component - it simply triggers the Tracer to sends traces to Weights & Biases
@@ -109,7 +112,10 @@ class WeaveConnector:
109
112
  weave_init_kwargs = self.weave_init_kwargs.copy()
110
113
  settings = weave_init_kwargs.get("settings", None)
111
114
  if isinstance(settings, UserSettings):
112
- weave_init_kwargs["settings"] = settings.model_dump(mode="json", exclude_defaults=True)
115
+ if isinstance(settings, BaseModel):
116
+ weave_init_kwargs["settings"] = settings.model_dump(mode="json", exclude_defaults=True)
117
+ elif is_dataclass(settings):
118
+ weave_init_kwargs["settings"] = asdict(settings)
113
119
 
114
120
  return default_to_dict(self, pipeline_name=self.pipeline_name, weave_init_kwargs=weave_init_kwargs)
115
121
 
@@ -42,6 +42,7 @@ class WeaveSpan(Span):
42
42
  self._attributes[key] = value
43
43
 
44
44
  def set_tags(self, tags: dict[str, Any]) -> None:
45
+ """Set multiple tags at once by iterating over the provided dictionary."""
45
46
  for k, v in tags.items():
46
47
  self.set_tag(k, v)
47
48
 
@@ -56,9 +57,11 @@ class WeaveSpan(Span):
56
57
  return {"weave.call_id": self._call.id, "weave.run_id": getattr(self._call, "run_id", "")}
57
58
 
58
59
  def set_call(self, call: Call) -> None:
60
+ """Set the underlying Weave Call object for this span."""
59
61
  self._call = call
60
62
 
61
63
  def get_attributes(self) -> dict[str, Any]:
64
+ """Return the accumulated attributes dictionary for this span."""
62
65
  return self._attributes
63
66
 
64
67
 
@@ -92,6 +95,7 @@ class WeaveTracer(Tracer):
92
95
 
93
96
  @staticmethod
94
97
  def create_call(attributes: dict, client: WeaveClient, parent_span: WeaveSpan | None, operation_name: str) -> Call:
98
+ """Create and return a Weave Call from the given span attributes and client."""
95
99
  comp_name = attributes.pop("haystack.component.name", "")
96
100
  comp_type = attributes.pop("haystack.component.type", "")
97
101
  comp_input = attributes.pop("haystack.component.input", {})
@@ -97,9 +97,7 @@ class TestWeaveConnector:
97
97
  serialized: dict[str, Any] = connector.to_dict()
98
98
 
99
99
  assert serialized["init_parameters"]["pipeline_name"] == "test_pipeline"
100
- assert serialized["init_parameters"]["weave_init_kwargs"] == {
101
- "settings": {"implicitly_patch_integrations": False}
102
- }
100
+ assert serialized["init_parameters"]["weave_init_kwargs"]["settings"]["implicitly_patch_integrations"] is False
103
101
  assert "type" in serialized
104
102
  assert serialized["type"] == "haystack_integrations.components.connectors.weave.weave_connector.WeaveConnector"
105
103
 
@@ -108,7 +106,7 @@ class TestWeaveConnector:
108
106
  assert isinstance(deserialized, WeaveConnector)
109
107
  assert deserialized.pipeline_name == "test_pipeline"
110
108
  assert deserialized.tracer is None # tracer is only initialized with warm_up
111
- assert deserialized.weave_init_kwargs == {"settings": {"implicitly_patch_integrations": False}}
109
+ assert deserialized.weave_init_kwargs["settings"]["implicitly_patch_integrations"] is False
112
110
 
113
111
  def test_pipeline_tracing(self, mock_weave_client: Mock, sample_pipeline: Pipeline) -> None:
114
112
  """Test that pipeline operations are correctly traced"""
@@ -1,9 +0,0 @@
1
- # Changelog
2
-
3
- ## [integrations/weave-v3.0.0] - 2026-01-13
4
-
5
- ### 🧹 Chores
6
-
7
- - Standardize Weave integration (#2738)
8
-
9
- <!-- generated by git-cliff -->
@@ -1,29 +0,0 @@
1
- loaders:
2
- - ignore_when_discovered:
3
- - __init__
4
- modules:
5
- - haystack_integrations.components.connectors.weave.weave_connector
6
- - haystack_integrations.tracing.weave.tracer
7
- search_path:
8
- - ../src
9
- type: haystack_pydoc_tools.loaders.CustomPythonLoader
10
- processors:
11
- - do_not_filter_modules: false
12
- documented_only: true
13
- expression: null
14
- skip_empty_modules: true
15
- type: filter
16
- - type: smart
17
- - type: crossref
18
- renderer:
19
- description: Weights & Bias integration for Haystack
20
- id: integrations-weave
21
- markdown:
22
- add_member_class_prefix: false
23
- add_method_class_prefix: true
24
- classdef_code_block: false
25
- descriptive_class_title: false
26
- descriptive_module_title: true
27
- filename: weave.md
28
- title: Weave
29
- type: haystack_pydoc_tools.renderers.DocusaurusRenderer
File without changes