[Bug]: plot.line_series: align outer-container annotations with runtime requirements
Author: humdrum00001010Created Sep 10, 2026Updated Sep 15, 2026
Describe the bug
wandb.plot.line_series declares Iterable for xs, ys, and keys, but the implementation indexes or calls len() on each outer container. Ordinary iterators therefore fail despite fitting the declared container types. The same values in lists work.
Main has the same signature and sequence operations. The docstring describes sequences, so the annotations and accepted containers currently disagree.
Minimal reproduction
import wandb
print(wandb.__version__)
print(wandb.plot.line_series([0, 1], [[2, 3]], keys=["a"]).table.data)
for xs, ys, keys in [
(iter([0, 1]), [[2, 3]], ["a"]),
([0, 1], iter([[2, 3]]), ["a"]),
([0, 1], [[2, 3]], iter(["a"])),
]:
try:
wandb.plot.line_series(xs, ys, keys=keys)
except TypeError as error:
print(error)0.30.0
[[0, 'a', 2], [1, 'a', 3]]
'list_iterator' object is not subscriptable
object of type 'list_iterator' has no len()
object of type 'list_iterator' has no len()The series are nonempty, numeric, and have matching lengths. No run or server is involved.
Expected behavior
Make the three outer-container annotations agree with the supported calling forms, or support the advertised iterables. This does not imply that inner series need the same restriction.
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