Skip to content

Commit 1d8f17a

Browse files
Copilotxadupre
andauthored
chore: include lengths in sankey mismatch errors
Agent-Logs-Url: https://github.com/sdpython/teachpyx/sessions/68526f45-813e-4c5a-959d-84afb8a8544a Co-authored-by: xadupre <22452781+xadupre@users.noreply.github.com>
1 parent ea69ae5 commit 1d8f17a

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

teachpyx/faq/faq_python.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -882,9 +882,15 @@ def graph_sankey(
882882
if orientations is None:
883883
orientations = [0] * len(flows)
884884
if len(labels) != len(flows):
885-
raise ValueError("labels and flows must have the same length.")
885+
raise ValueError(
886+
"labels and flows must have the same length, "
887+
f"got {len(labels)} and {len(flows)}."
888+
)
886889
if len(orientations) != len(flows):
887-
raise ValueError("orientations and flows must have the same length.")
890+
raise ValueError(
891+
"orientations and flows must have the same length, "
892+
f"got {len(orientations)} and {len(flows)}."
893+
)
888894

889895
import matplotlib.pyplot as plt
890896
from matplotlib.sankey import Sankey

0 commit comments

Comments
 (0)