Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(haystack): remove remaining haystack import #961

Merged
merged 1 commit into from
Aug 23, 2024
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
)
from wrapt import wrap_function_wrapper

import haystack
from openinference.instrumentation import OITracer, TraceConfig
from openinference.instrumentation.haystack._wrappers import _ComponentWrapper, _PipelineWrapper
from openinference.instrumentation.haystack.version import __version__
Expand All @@ -26,6 +25,8 @@ def instrumentation_dependencies(self) -> Collection[str]:
return _instruments

def _instrument(self, **kwargs: Any) -> None:
import haystack

if not (tracer_provider := kwargs.get("tracer_provider")):
tracer_provider = trace_api.get_tracer_provider()
if not (config := kwargs.get("config")):
Expand All @@ -51,6 +52,8 @@ def _instrument(self, **kwargs: Any) -> None:
)

def _uninstrument(self, **kwargs: Any) -> None:
import haystack

if self._original_pipeline_run is not None:
haystack.Pipeline.run = self._original_pipeline_run

Expand Down
Loading