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
2 changes: 1 addition & 1 deletion integrations/weave/LICENSE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ APPENDIX: How to apply the Apache License to your work.

To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives.

Copyright [yyyy] [name of copyright owner]
Copyright 2025 deepset GmbH

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# SPDX-FileCopyrightText: 2023-present deepset GmbH <[email protected]>
# SPDX-FileCopyrightText: 2025-present deepset GmbH <[email protected]>
#
# SPDX-License-Identifier: Apache-2.0

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# SPDX-FileCopyrightText: 2025-present deepset GmbH <[email protected]>
#
# SPDX-License-Identifier: Apache-2.0

from typing import Any

from haystack import component, default_from_dict, default_to_dict, logging, tracing
Expand Down Expand Up @@ -90,6 +94,8 @@ def warm_up(self) -> None:

@component.output_types(pipeline_name=str)
def run(self) -> dict[str, str]:
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
return {"pipeline_name": self.pipeline_name}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# SPDX-FileCopyrightText: 2023-present deepset GmbH <[email protected]>
# SPDX-FileCopyrightText: 2025-present deepset GmbH <[email protected]>
#
# SPDX-License-Identifier: Apache-2.0

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# SPDX-FileCopyrightText: 2025-present deepset GmbH <[email protected]>
#
# SPDX-License-Identifier: Apache-2.0

import contextlib
import os
from collections.abc import Iterator
Expand Down
4 changes: 4 additions & 0 deletions integrations/weave/tests/test_tracer.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# SPDX-FileCopyrightText: 2025-present deepset GmbH <[email protected]>
#
# SPDX-License-Identifier: Apache-2.0

import logging
from unittest.mock import patch

Expand Down
11 changes: 10 additions & 1 deletion integrations/weave/tests/test_weave_connector.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# SPDX-FileCopyrightText: 2025-present deepset GmbH <[email protected]>
#
# SPDX-License-Identifier: Apache-2.0

import os
from collections.abc import Generator
from typing import Any
Expand All @@ -21,7 +25,7 @@ class FailingComponent:
def run(self) -> dict[str, Any]:
"""Execute the component's logic - always raises an exception."""
msg = "Test error"
raise PipelineRuntimeError(msg)
raise PipelineRuntimeError(component_name="FailingComponent", component_type=FailingComponent, message=msg)


@pytest.fixture
Expand Down Expand Up @@ -146,6 +150,11 @@ def test_error_handling(self, mock_weave_client: Mock) -> None:
error_traces = [args for args in finish_call_args if args[1].get("exception") is not None]
assert len(error_traces) > 0

@pytest.mark.skipif(
not os.environ.get("WANDB_API_KEY", None),
reason="Export an env var called WANDB_API_KEY containing the Weights & Bias API key to run this test.",
)
@pytest.mark.integration
def test_run_method(self) -> None:
"""Test the basic run method of WeaveConnector"""
connector = WeaveConnector(pipeline_name="test_pipeline")
Expand Down