Commit 54a4212
committed
Change set_attributes to take a Mapping
This currently specifies a Dict[str, types.AttributeValue], which is invariant in its value type. As a result, you cannot pass a dictionary with a narrower value type, e.g. a dict[str, str]. But this should be allowed, since set_attributes simply adds all key-value pairs in its argument, and all such pairs are valied. Using Mapping takes care of this issue, since it's covariant in its value type.1 parent 29aad2e commit 54a4212
File tree
2 files changed
+4
-3
lines changed- opentelemetry-api/src/opentelemetry/trace
- opentelemetry-sdk/src/opentelemetry/sdk/trace
2 files changed
+4
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
79 | 79 | | |
80 | 80 | | |
81 | 81 | | |
82 | | - | |
| 82 | + | |
83 | 83 | | |
84 | 84 | | |
85 | 85 | | |
| |||
529 | 529 | | |
530 | 530 | | |
531 | 531 | | |
532 | | - | |
| 532 | + | |
533 | 533 | | |
534 | 534 | | |
535 | 535 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
| 33 | + | |
33 | 34 | | |
34 | 35 | | |
35 | 36 | | |
| |||
842 | 843 | | |
843 | 844 | | |
844 | 845 | | |
845 | | - | |
| 846 | + | |
846 | 847 | | |
847 | 848 | | |
848 | 849 | | |
| |||
0 commit comments