Added dbt Manifest V8 Compatibility (#10024)

* Added v8 compatibility

* Added condition
This commit is contained in:
Onkar Ravgan 2023-01-31 14:06:06 +05:30 committed by GitHub
parent 0b3996d2fa
commit b754121425
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -439,8 +439,14 @@ class DbtSource(DbtServiceSource): # pylint: disable=too-many-public-methods
dbt_raw_query = self.get_dbt_raw_query(manifest_node)
datamodel_path = None
if manifest_node.root_path and manifest_node.original_file_path:
if manifest_node.original_file_path:
if (
hasattr(manifest_node, "root_path")
and manifest_node.root_path
):
datamodel_path = f"{manifest_node.root_path}/{manifest_node.original_file_path}"
else:
datamodel_path = manifest_node.original_file_path
data_model_link = DataModelLink(
fqn=fqn.build(
@ -492,7 +498,11 @@ class DbtSource(DbtServiceSource): # pylint: disable=too-many-public-methods
Method to fetch the upstream nodes
"""
upstream_nodes = []
if dbt_node.depends_on and dbt_node.depends_on.nodes:
if (
hasattr(dbt_node, "depends_on")
and dbt_node.depends_on
and dbt_node.depends_on.nodes
):
for node in dbt_node.depends_on.nodes:
try:
parent_node = manifest_entities[node]