Skip to content

Commit 9f3349f

Browse files
committed
fix bug
1 parent cc7820b commit 9f3349f

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

langfuse/_client/client.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1660,7 +1660,12 @@ def update_current_trace(
16601660
current_otel_span = self._get_current_otel_span()
16611661

16621662
if current_otel_span is not None:
1663-
span = LangfuseSpan(
1663+
existing_observation_type = current_otel_span.attributes.get(
1664+
LangfuseOtelSpanAttributes.OBSERVATION_TYPE, "span"
1665+
)
1666+
# We need to preserve the class to keep the corret observation type
1667+
span_class = self._get_span_class(existing_observation_type)
1668+
span = span_class(
16641669
otel_span=current_otel_span,
16651670
langfuse_client=self,
16661671
environment=self._environment,

tests/test_core_sdk.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1931,7 +1931,6 @@ def test_start_as_current_observation_types():
19311931
assert len(observations) == 1, f"Expected one {obs_type.upper()} observation"
19321932

19331933

1934-
@pytest.mark.skip(reason="Works after OSS release 3.102")
19351934
def test_that_generation_like_properties_are_actually_created():
19361935
"""Test that generation-like observation types properly support generation properties."""
19371936
from langfuse._client.constants import (

0 commit comments

Comments
 (0)