Skip to content

Commit

Permalink
fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
syou6162 committed Jan 1, 2025
1 parent 4ad33d0 commit 7453939
Showing 1 changed file with 20 additions and 10 deletions.
30 changes: 20 additions & 10 deletions dbterd/adapters/algos/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -475,18 +475,28 @@ def get_relationships(manifest: Manifest, **kwargs) -> List[Ref]:
"""
rule = get_algo_rule(**kwargs)
refs = []
for x in get_test_nodes_by_rule_name(manifest=manifest, rule_name=rule.get("name").lower()):
for x in get_test_nodes_by_rule_name(
manifest=manifest, rule_name=rule.get("name").lower()
):
node = manifest.nodes[x]
kwargs = node.test_metadata.kwargs
to_column = str(
kwargs.get(rule.get("c_to"))
or "_and_".join(kwargs.get(f'{rule.get("c_to")}s', "unknown"))
).replace('"', "").lower()
from_column = str(
kwargs.get("column_name")
or kwargs.get(rule.get("c_from"))
or "_and_".join(kwargs.get(f'{rule.get("c_from")}s', "unknown"))
).replace('"', "").lower()
to_column = (
str(
kwargs.get(rule.get("c_to"))
or "_and_".join(kwargs.get(f'{rule.get("c_to")}s', "unknown"))
)
.replace('"', "")
.lower()
)
from_column = (
str(
kwargs.get("column_name")
or kwargs.get(rule.get("c_from"))
or "_and_".join(kwargs.get(f'{rule.get("c_from")}s', "unknown"))
)
.replace('"', "")
.lower()
)
ref = Ref(
name=x,
table_map=get_table_map(test_node=node, **kwargs),
Expand Down

0 comments on commit 7453939

Please sign in to comment.