Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix exception handling when no node type #414

Merged
merged 3 commits into from
Nov 17, 2023
Merged
Changes from all commits
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
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
Loading