Skip to content

Commit

Permalink
Merge pull request #910 from InfuseAI/bug/sc-32474/bug-piperider-conf…
Browse files Browse the repository at this point in the history
…ig-loader-should-support

[Bug] sc-32474 Fix compare error if no global dbt config
  • Loading branch information
kentwelcome authored Oct 23, 2023
2 parents ae7f51c + 3e83948 commit 50d19c5
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'))
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 50d19c5

Please sign in to comment.