Add error for batch of 0

This commit is contained in:
Nuno Campos 2023-08-18 15:14:29 +01:00
parent 3458489936
commit db4b256a28

View File

@ -238,6 +238,8 @@ class Runnable(Generic[Input, Output], ABC):
Helper method to get a list of configs from a single config or a list of
configs, useful for subclasses overriding batch() or abatch().
"""
if length < 1:
raise ValueError(f"length must be >= 1, but got {length}")
if isinstance(config, list) and len(config) != length:
raise ValueError(
f"config must be a list of the same length as inputs, "