Skip to content

Commit

Permalink
Fix exception handling when no node type (#414)
Browse files Browse the repository at this point in the history
* Add validation to node type handling

* Revert validation due to secrets deep merge
  • Loading branch information
BAntonellini authored Nov 17, 2023
1 parent a3cd328 commit 628f8d2
Showing 1 changed file with 6 additions and 11 deletions.
17 changes: 6 additions & 11 deletions dbt_coves/tasks/generate/airflow_dags.py
Original file line number Diff line number Diff line change
Expand Up @@ -259,17 +259,12 @@ def generate_node(self, node_name: str, node_conf: Dict[str, Any]):
"""
Node generation entrypoint
"""
try:
node_type = node_conf.pop("type")
if node_type == "task_group":
self.generate_task_group(node_name, node_conf)
if node_type == "task":
task_output = self.generate_task_output(node_name, node_conf)
self.dag_output["dag"].extend(task_output)
except KeyError:
raise GenerateAirflowDagsException(
"No node-type provided, please specify node type: 'task' or 'task_group'"
)
node_type = node_conf.pop("type", "")
if node_type == "task_group":
self.generate_task_group(node_name, node_conf)
if node_type == "task":
task_output = self.generate_task_output(node_name, node_conf)
self.dag_output["dag"].extend(task_output)

def get_generator_class(self, generator: str):
"""
Expand Down

0 comments on commit 628f8d2

Please sign in to comment.