Skip to content

Commit

Permalink
Support to parse query diff with joins result doing recce summary
Browse files Browse the repository at this point in the history
Signed-off-by: Wei-Chun, Chang <[email protected]>
  • Loading branch information
wcchang1115 committed May 7, 2024
1 parent abf6cec commit e2a7e51
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
16 changes: 15 additions & 1 deletion recce/tasks/query.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,5 +233,19 @@ class QueryDiffResultDiffer(TaskResultDiffer):
def _check_result_changed_fn(self, result):
base = result.get('base')
current = result.get('current')
diff = result.get('diff')

return TaskResultDiffer.diff(base, current)
if diff is None:
return TaskResultDiffer.diff(base, current)
else:
base = dict(columns=[], data=[])
current = dict(columns=[], data=[])
base['columns'] = diff['columns'][:-2]
current['columns'] = diff['columns'][:-2]

for data in diff['data']:
if data[-2] is True:
base['data'].append(data[:-2])
elif data[-1] is True:
current['data'].append(data[:-2])
return TaskResultDiffer.diff(base, current)
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ def _get_version():
'ruamel.yaml<0.18.0',
'click>=7.1',
'dbt-core>=1.5',
'deepdiff',
'portalocker',
'fastapi',
'itsdangerous',
Expand Down

0 comments on commit e2a7e51

Please sign in to comment.