Skip to content

Commit

Permalink
[join-] return the check for row not existing in sheet
Browse files Browse the repository at this point in the history
After de0ac67, when sheet did not exist in row, None would get
returned as TypedExceptioNWrapper.
  • Loading branch information
anjakefala committed Oct 23, 2023
1 parent a155077 commit 91ba6ff
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions visidata/features/join.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,13 @@ def __init__(self, name='', keycols=None, **kwargs):
self.keycols = keycols

def calcValue(self, row):
c = self.keycols[0]
return c.getTypedValue(row[c.sheet])
vals = set()
for i, c in enumerate(self.keycols):
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))
return vals.pop()

def putValue(self, row, value):
for i, c in enumerate(self.keycols):
Expand Down

0 comments on commit 91ba6ff

Please sign in to comment.