Repository navigation
fix: Remove unpack parameter from set_data_normalized() - #8149
Draft
alexander-alderman-webb wants to merge 1 commit into
Draft
alexander-alderman-webb wants to merge 1 commit into
alexander-alderman-webb wants to merge 1 commit into
Conversation
set_data_normalized()unpack parameter from set_data_normalized()
Comment on lines
480
to
+494
| @@ -492,9 +490,8 @@ def set_data_normalized( | |||
| span: "Union[Span, StreamedSpan]", | |||
| key: str, | |||
| value: "Any", | |||
| unpack: bool = True, | |||
| ) -> None: | |||
| normalized = _normalize_data(value, unpack=unpack) | |||
| normalized = _normalize_data(value) | |||
Contributor
There was a problem hiding this comment.
Singleton AI response lists are now emitted as JSON arrays
set_data_normalized() now preserves list values, then JSON-serializes them as arrays. Several integrations pass text outputs as lists even when there is only one text block, so a span that previously exposed "Hi, I'm Claude." now exposes ["Hi, I'm Claude."]. This changes the shape of the emitted span attribute and conflicts with existing tests and consumers expecting a scalar. Flatten scalar-semantic outputs at those call sites, or update the tests and document the new attribute shape if this is intentional.
Evidence
_normalize_data()preserves lists, andset_data_normalized()JSON-serializes non-scalars; a one-item list therefore remains a JSON array string.anthropic._set_output_data()collects text blocks inoutput_messages["response"]and passes that list toset_data_normalized().- The Anthropic tests still assert a bare
"Hi, I'm Claude."value for these responses, confirming the emitted shape no longer matches the existing expectation. - LangChain also passes nested generation text lists to
set_data_normalized(), so singleton generation results are affected as well.
Identified by Warden · code-review · 8XB-P9Q
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Issues
Reminders
uv run ruff.feat:,fix:,ref:,meta:)