ref(litellm): Remove set_data_normalized for primitive attributes#5514
ref(litellm): Remove set_data_normalized for primitive attributes#5514alexander-alderman-webb wants to merge 1 commit intomasterfrom
set_data_normalized for primitive attributes#5514Conversation
Codecov Results 📊✅ 13 passed | Total: 13 | Pass Rate: 100% | Execution Time: 7.78s All tests are passing successfully. ❌ Patch coverage is 0.00%. Project has 13688 uncovered lines. Files with missing lines (180)
Generated by Codecov Action |
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.
| for key, value in litellm_params.items(): | ||
| if value is not None: | ||
| set_data_normalized(span, f"gen_ai.litellm.{key}", value) | ||
| span.set_data(f"gen_ai.litellm.{key}", value) |
There was a problem hiding this comment.
Non-serializable span data now possible
Medium Severity
Replacing set_data_normalized() with span.set_data() can store non-JSON-serializable values from kwargs (or completion_response.model) directly into Span._data. If any of these values are pydantic objects, enums, or other custom types, span serialization may fail or produce unexpected payloads when sending events.
Additional Locations (1)
There was a problem hiding this comment.
The types of these attributes are strings, it's api_base, api_version and custom_llm_provider.


Description
Remove
set_data_normalized()for attributes that do not require normalization.Issues
Reminders
tox -e linters.feat:,fix:,ref:,meta:)