ref(huggingface-hub): Remove set_data_normalized for the gen_ai.response.finish_reasons attribute#5507
Conversation
…nse.finish_reasons attribute
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. |
Codecov Results 📊✅ 13 passed | Total: 13 | Pass Rate: 100% | Execution Time: 12.44s 📊 Comparison with Base Branch
✨ No test changes detected All tests are passing successfully. ❌ Patch coverage is 0.00%. Project has 13670 uncovered lines. Files with missing lines (180)
Coverage diff@@ Coverage Diff @@
## main #PR +/-##
==========================================
+ Coverage 25.70% 30.84% +5.14%
==========================================
Files 189 189 —
Lines 19767 19767 —
Branches 6408 6408 —
==========================================
+ Hits 5080 6097 +1017
- Misses 14687 13670 -1017
- Partials 420 467 +47Generated by Codecov Action |
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 finish_reason is not None: | ||
| set_data_normalized( | ||
| span, |
There was a problem hiding this comment.
Non-serializable finish reason stored
High Severity
Replacing set_data_normalized with span.set_data for SPANDATA.GEN_AI_RESPONSE_FINISH_REASONS can store non-primitive finish_reason values (e.g., enums/objects/lists) without normalization, which can break span/event serialization or change the expected stored type for gen_ai.response.finish_reasons.
Additional Locations (2)
There was a problem hiding this comment.
Following the types here they look to be str or None:
https://github.com/search?q=repo%3Ahuggingface%2Fhuggingface_hub+finish_reason%3A+&type=code


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