Skip to content

Commit 9b3b196

Browse files
nathan-skydioaaron-skydio
authored andcommitted
Fix symforce codegen ValueError error message
We used `zip` on two lists known to be different sizes, which cuts off the non-matching values in the error message. E.g. if `formatted_symbols` has length 1 and `flattened_value` has length 0 we would print `The following symbol/value pairs should match: []` which isn't helpful. This makes it so that we actually print the full list of symbols/values that should match in the error message. Topic: fix_codegen_util_error_msg GitOrigin-RevId: dc1f6a946659cf33d813fb529409094e921d60be
1 parent 27e3ba5 commit 9b3b196

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

symforce/codegen/codegen_util.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -441,7 +441,7 @@ def get_formatted_list(
441441
)
442442
# Only print matches if flattened_value isn't filled with expressions
443443
if format_as_inputs:
444-
matches = list(zip(formatted_symbols, flattened_value))
444+
matches = list(itertools.zip_longest(formatted_symbols, flattened_value))
445445
error_text += f"The following symbol/value pairs should match: {matches}"
446446
raise ValueError(error_text)
447447

0 commit comments

Comments
 (0)