Skip to content

Commit

Permalink
[Bug] sc-32474 Fix compare error if no global dbt config
Browse files Browse the repository at this point in the history
Signed-off-by: Kent Huang <[email protected]>
  • Loading branch information
kentwelcome committed Oct 23, 2023
1 parent 62890e7 commit 3e83948
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions piperider_cli/recipes/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,9 @@ def prepare_dbt_resources_candidate(cfg: RecipeConfiguration, options: Dict):
execute_dbt_parse(cfg.target)
else:
execute_dbt_compile(cfg.target)
dbt_project = dbtutil.load_dbt_project(config.dbt.get('projectDir'))
# if global dbt config exists, use global dbt else use the first datasource
dbt = config.dbt if config.dbt else config.dataSources[0].args.get('dbt')
dbt_project = dbtutil.load_dbt_project(dbt.get('projectDir'))

Check warning on line 308 in piperider_cli/recipes/__init__.py

View check run for this annotation

Codecov / codecov/patch

piperider_cli/recipes/__init__.py#L307-L308

Added lines #L307 - L308 were not covered by tests
target_path = dbt_project.get('target-path') if dbt_project.get('target-path') else 'target'

if not cfg.auto_generated:
Expand Down Expand Up @@ -461,7 +463,8 @@ def execute_dbt_parse(model: RecipeModel, project_dir: str = None, profiles_dir:
console.print()


def execute_recipe_archive(cfg: RecipeConfiguration, recipe_type='base', debug=False, event_payload=CompareEventPayload()):
def execute_recipe_archive(cfg: RecipeConfiguration, recipe_type='base', debug=False,
event_payload=CompareEventPayload()):
"""
We execute a recipe in the following steps:
1. export the repo with specified commit or branch if needed
Expand Down

0 comments on commit 3e83948

Please sign in to comment.