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

Commit 62e15c0

Browse files
dlawinerezsh
authored andcommitted
json->dict
1 parent 51f90d5 commit 62e15c0

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

data_diff/__main__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -411,7 +411,7 @@ def _main(
411411
# required to create this variable before get_stats
412412
diff_list = list(diff_iter)
413413
if json_output:
414-
rich.print(json.dumps(diff_iter.get_stats_json()))
414+
rich.print(json.dumps(diff_iter.get_stats_dict()))
415415
else:
416416
rich.print(diff_iter.get_stats_string())
417417

data_diff/diff_tables.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ def get_stats_string(self):
144144

145145
return string_output
146146

147-
def get_stats_json(self):
147+
def get_stats_dict(self):
148148

149149
diff_stats = self._get_stats()
150150
json_output = {

tests/test_api.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,13 +91,13 @@ def test_api_get_stats_string(self):
9191
t1.database.close()
9292
t2.database.close()
9393

94-
def test_api_get_stats_json(self):
94+
def test_api_get_stats_dict(self):
9595
expected_dict = {'rows_A': 5, 'rows_B': 4, 'exclusive_A': 1, 'exclusive_B': 0, 'updated': 0, 'unchanged': 4, 'total': 1, 'stats': {'rows_downloaded': 5}}
9696
t1 = connect_to_table(TEST_MYSQL_CONN_STRING, self.table_src_name)
9797
t2 = connect_to_table(TEST_MYSQL_CONN_STRING, self.table_dst_name)
9898
diff = diff_tables(t1, t2)
9999
diff_list = list(diff)
100-
output = diff.get_stats_json()
100+
output = diff.get_stats_dict()
101101

102102
self.assertEqual(expected_dict, output)
103103
self.assertIsNotNone(diff)

0 commit comments

Comments
 (0)