[Bug]: Trace: align dictionary value annotations across its properties
Describe the bug
Trace.metadata, Trace.inputs, and Trace.outputs getters declare dict[str, str] | None, and their setters declare string-only dictionary values. Normal Trace construction and updates support numeric, nested, and other non-string values; the getters return those values unchanged.
The underlying Span.attributes and Result.inputs/outputs use dict[str, Any] | None. The Trace constructor's own example includes numeric metadata, whereas the property annotations imply every retrieved value is a string.
Minimal reproduction
from wandb.sdk.data_types.trace_tree import Trace
trace = Trace(
"example",
metadata={"attempts": 2},
inputs={"x": [1, 2]},
outputs={"score": 0.9},
)
print(trace.metadata) # {'attempts': 2}
print(trace.inputs) # {'x': [1, 2]}
print(trace.outputs) # {'score': 0.9}
if trace.metadata is not None:
trace.metadata["attempts"].upper()The final operation raises AttributeError: 'int' object has no attribute 'upper', contradicting the declared string-valued return. No logging, login, or server is involved.
Expected behavior
Align these related getter/setter value annotations with the dictionaries supported by the Trace API.
Environment
- W&B SDK: 0.30.0; relevant source is identical on main
8f93d444e29e4d1a50a888899f51051012ee2679 - Python: 3.12.12
- OS: macOS 26.1, arm64
- W&B server: not applicable
Source: wandb/wandb