Skip to content
This repository was archived by the owner on May 17, 2024. It is now read-only.

Commit e0ee741

Browse files
authored
Merge pull request #635 from datafold/fix-keyerror-for-no-differences-diff-json
fix KeyError exception for --json diffs
2 parents b4670d3 + b570f3f commit e0ee741

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

data_diff/diff_tables.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -177,9 +177,7 @@ def get_stats_dict(self, is_dbt: bool = False):
177177
"total": sum(diff_stats.diff_by_sign.values()),
178178
"stats": self.stats,
179179
}
180-
if diff_stats.extra_column_diffs:
181-
json_output["values"] = diff_stats.extra_column_diffs
182-
180+
json_output["values"] = diff_stats.extra_column_diffs or {}
183181
return json_output
184182

185183

tests/test_api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ def test_api_get_stats_dict(self):
6666
"updated": 0,
6767
"unchanged": 4,
6868
"total": 1,
69-
# "stats": {"rows_downloaded": 5},
69+
"values": {},
7070
}
7171
t1 = connect_to_table(TEST_MYSQL_CONN_STRING, self.table_src_name)
7272
t2 = connect_to_table(TEST_MYSQL_CONN_STRING, self.table_dst_name)

0 commit comments

Comments
 (0)