From fde57e21d78441941764c7492874d6b3edcb006e Mon Sep 17 00:00:00 2001 From: Hagen Wierstorf Date: Fri, 17 Jan 2025 18:20:42 +0100 Subject: [PATCH] Fix tests --- audformat/core/utils.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/audformat/core/utils.py b/audformat/core/utils.py index afc757f9..e845d149 100644 --- a/audformat/core/utils.py +++ b/audformat/core/utils.py @@ -1079,7 +1079,7 @@ def join_labels( if not isinstance(labels, list): labels = list(labels) - if misc_table_ids := [x for x in labels if isinstance(x, str)]: + if len(misc_table_ids := [x for x in labels if isinstance(x, str)]) > 1: raise ValueError( f"The following string values were provided: '" f"{misc_table_ids}'. " @@ -1098,7 +1098,8 @@ def join_labels( return labels[0] items = audeer.flatten_list([list(x) for x in labels]) - if dtypes := sorted(list({str(type(x)) for x in items})): + dtypes = sorted(list({str(type(x)) for x in items})) + if len(dtypes) > 1: raise ValueError( f"Elements or keys must " f"have the same dtype, "