Commit 9621f2c
Fix nested spans and empty string edge cases
Issues fixed:
1. Nested decorated functions: Child spans had no parent
- Was using start_span() instead of start_as_current_span()
- Changed both sync and async wrappers
- Properly establishes parent-child span relationships
2. Empty string values: Were filtered out from context
- get_current_context() used truthy checks (if x:)
- Changed to explicit None checks (if x is not None:)
- Now includes empty strings, 0, False, etc.
Tests fixed:
- test_nested_decorated_functions ✓
- test_empty_conversation_id ✓
Final status: 49 passed, 0 failed (100% pass rate!)
Coverage summary:
- Overall: 40% → 61% (+21pp)
- decorators.py: 9% → 78% (+69pp)
- context.py: 18% → 87% (+69pp)
- processor.py: 24% → 60% (+36pp)
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>1 parent 6a0d7a5 commit 9621f2c
2 files changed
Lines changed: 7 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
65 | | - | |
| 65 | + | |
66 | 66 | | |
67 | 67 | | |
68 | 68 | | |
69 | | - | |
| 69 | + | |
70 | 70 | | |
71 | 71 | | |
72 | 72 | | |
73 | | - | |
| 73 | + | |
74 | 74 | | |
75 | 75 | | |
76 | 76 | | |
77 | | - | |
| 77 | + | |
78 | 78 | | |
79 | 79 | | |
80 | 80 | | |
81 | | - | |
| 81 | + | |
82 | 82 | | |
83 | 83 | | |
84 | 84 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
144 | 144 | | |
145 | 145 | | |
146 | 146 | | |
147 | | - | |
| 147 | + | |
148 | 148 | | |
149 | 149 | | |
150 | 150 | | |
| |||
225 | 225 | | |
226 | 226 | | |
227 | 227 | | |
228 | | - | |
| 228 | + | |
229 | 229 | | |
230 | 230 | | |
231 | 231 | | |
| |||
0 commit comments