Skip to content

Commit c8ab2fb

Browse files
committed
Raise exception if empty list provided to csv_bytes_list_to_numpy
1 parent 7322abf commit c8ab2fb

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

cmdstanpy/utils/stancsv.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,8 @@ def csv_bytes_list_to_numpy(
6464
import polars as pl
6565

6666
try:
67+
if not csv_bytes_list:
68+
raise ValueError("No data found to parse")
6769
num_cols = csv_bytes_list[0].count(b",") + 1
6870
out: npt.NDArray[np.float64] = (
6971
pl.read_csv(

0 commit comments

Comments
 (0)