Skip to content

Commit

Permalink
Merge pull request #308 from DataRecce/bug/add-missing-dependencies
Browse files Browse the repository at this point in the history
[Bug] add missing dependency
kentwelcome authored May 8, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
2 parents abf6cec + a942448 commit 45a2915
Showing 2 changed files with 16 additions and 6 deletions.
21 changes: 15 additions & 6 deletions recce/summary.py
Original file line number Diff line number Diff line change
@@ -333,11 +333,15 @@ def _find_run_by_check_id(check_id):

def generate_mermaid_lineage_graph(graph: LineageGraph):
content = 'graph LR\n'
is_not_modified = False
# Only show the modified nodes and there children
queue = list(graph.modified_set)
display_nodes = set()
display_edge = set()

if len(queue) == 0:
is_not_modified = True

while len(queue) > 0:
node_id = queue.pop(0)
if node_id in display_nodes:
@@ -354,15 +358,15 @@ def generate_mermaid_lineage_graph(graph: LineageGraph):
display_edge.add(edge_id)
content += graph.get_edge_str(edge_id)

return content
return content, is_not_modified


def generate_markdown_summary(ctx, summary_format: str = 'markdown'):
curr_lineage = ctx.get_lineage(base=False)
base_lineage = ctx.get_lineage(base=True)
graph = _build_lineage_graph(base_lineage, curr_lineage)
graph.checks = generate_check_summary(base_lineage, curr_lineage)
mermaid_content = generate_mermaid_lineage_graph(graph)
mermaid_content, is_empty_graph = generate_mermaid_lineage_graph(graph)
check_content = None

def _formate_changes(changes):
@@ -386,15 +390,20 @@ def _formate_changes(changes):
elif summary_format == 'check':
return check_content
elif summary_format == 'markdown':
# TODO: Check the markdown output content is longer than 65535 characters.
# If it is, we should reduce the content length.
content = f'''
# Recce Summary

content = '# Recce Summary\n'

if is_empty_graph is False:
content += f'''
## Lineage Graph
```mermaid
{mermaid_content}
```
'''
else:
content += '''
## Lineage Graph
No changed module detected.
'''
if check_content:
content += f'''
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -28,6 +28,7 @@ def _get_version():
install_requires=[
'ruamel.yaml<0.18.0',
'click>=7.1',
'deepdiff',
'dbt-core>=1.5',
'portalocker',
'fastapi',

0 comments on commit 45a2915

Please sign in to comment.