Skip to content

Commit

Permalink
[join-] improve error message for inconsistent key columns
Browse files Browse the repository at this point in the history
Multiple messages are now identical and get batched into a single line.
Mention sheets names and column names instead of values.
Offer guidance for fixing.
  • Loading branch information
anjakefala committed Nov 25, 2023
1 parent d3b8183 commit 01a121a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion visidata/features/join.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ def calcValue(self, row):
if row[c.sheet] is not None:
vals.add(c.getTypedValue(row[c.sheet]))
if len(vals) != 1:
vd.warning(f'inconsistent keys: ' + str(vals))
vd.warning(f"The source key columns of {', '.join([col.sheet.name + ':' + col.name for col in self.keycols])}, have different types. Type the source columns before joining.")
return vals.pop()

def putValue(self, row, value):
Expand Down

0 comments on commit 01a121a

Please # to comment.