ref(openai): Remove set_data_normalized for primitive attributes#5513
ref(openai): Remove set_data_normalized for primitive attributes#5513alexander-alderman-webb wants to merge 1 commit intomasterfrom
set_data_normalized for primitive attributes#5513Conversation
Semver Impact of This PR🟢 Patch (bug fixes) 📋 Changelog PreviewThis is how your changes will appear in the changelog. Bug Fixes 🐛Openai
Other
Documentation 📚
Internal Changes 🔧
🤖 This preview updates automatically when you update the PR. |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
|
|
||
| if value is not None and _is_given(value): | ||
| set_data_normalized(span, attribute, value) | ||
| span.set_data(attribute, value) |
There was a problem hiding this comment.
Model parameter enum not normalized to string
Medium Severity
The model parameter from kwargs can be a ChatModel enum according to the OpenAI SDK type hints (Union[str, ChatModel]), but it's now passed directly to span.set_data without normalization. This causes enums to be serialized via repr() (producing output like "<ChatModel.GPT_4O: 'gpt-4o'>") instead of being normalized to their string value. The previous set_data_normalized call handled this correctly by converting non-primitive types to strings.
There was a problem hiding this comment.
Thanks I'll handle this case.


Description
Remove
set_data_normalized()for attributes that do not require normalization.Move setting
gen_ai.operation_nameto the top level of patches for top-level functions, as the attribute was previously set in all code paths.Issues
Reminders
tox -e linters.feat:,fix:,ref:,meta:)