Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[join-] prevent diff error for empty merge cells #2400

Merged
merged 3 commits into from
May 22, 2024
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 6 additions & 1 deletion visidata/features/join.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,11 @@ def putValue(self, row, value):

def isDiff(self, row, value):
col = list(self.cols.values())[0]
return col and value != col.getValue(row[col.sheet])
if not col:
return False
if row[col.sheet] is None:
return True
return value != col.getValue(row[col.sheet])


#### slicing and dicing
Expand Down Expand Up @@ -196,6 +200,7 @@ def loader(self):
self.setKeys(self.columns)

allcols = collections.defaultdict(dict) # colname: { sheet: origcol, ... }
# MergeColumn relies on allcols having sheets in this specific order
for sheetnum, vs in enumerate(sheets):
for c in vs.visibleCols:
if c not in self.sheetKeyCols[vs]:
Expand Down