Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
renamed node_pattern as node_type_pattern
  • Loading branch information
vijayan-nallasami-curve committed Jun 16, 2021
commit e838fce95f67e609681f61f63bf66802a5f1f735
12 changes: 6 additions & 6 deletions metadata-ingestion/src/datahub/ingestion/source/dbt.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class DBTConfig(ConfigModel):
env: str = "PROD"
target_platform: str
load_schemas: bool
node_pattern: AllowDenyPattern = AllowDenyPattern.allow_all()
node_type_pattern: AllowDenyPattern = AllowDenyPattern.allow_all()


class DBTColumn:
Expand Down Expand Up @@ -93,15 +93,15 @@ def extract_dbt_entities(
load_catalog: bool,
target_platform: str,
environment: str,
node_pattern: AllowDenyPattern,
node_type_pattern: AllowDenyPattern,
) -> List[DBTNode]:
dbt_entities = []
for key in nodes:
node = nodes[key]
dbtNode = DBTNode()

# check if node pattern allowed based on config file
if not node_pattern.allowed(node["resource_type"]):
if not node_type_pattern.allowed(node["resource_type"]):
continue
dbtNode.dbt_name = key
dbtNode.database = node["database"]
Expand Down Expand Up @@ -157,7 +157,7 @@ def loadManifestAndCatalog(
load_catalog: bool,
target_platform: str,
environment: str,
node_pattern: AllowDenyPattern,
node_type_pattern: AllowDenyPattern,
) -> List[DBTNode]:
with open(manifest_path, "r") as manifest:
with open(catalog_path, "r") as catalog:
Expand All @@ -180,7 +180,7 @@ def loadManifestAndCatalog(
load_catalog,
target_platform,
environment,
node_pattern,
node_type_pattern,
)

return nodes
Expand Down Expand Up @@ -344,7 +344,7 @@ def get_workunits(self) -> Iterable[MetadataWorkUnit]:
self.config.load_schemas,
self.config.target_platform,
self.config.env,
self.config.node_pattern,
self.config.node_type_pattern,
)

for node in nodes:
Expand Down