Skip to content

Commit

Permalink
address pr comments round 2
Browse files Browse the repository at this point in the history
  • Loading branch information
aranke committed Feb 19, 2025
1 parent 3c39527 commit cd7472b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion core/dbt/config/profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -276,10 +276,11 @@ def render_profile(
elif "target" in raw_profile:
# render the target if it was parsed from yaml
target_name = renderer.render_value(raw_profile["target"])
elif is_secondary and len(raw_profile["outputs"]) == 1:
elif is_secondary and len(raw_profile.get("outputs", [])) == 1:
# if we only have one target, we can infer the target name
# currently, this is only used for secondary profiles
target_name = next(iter(raw_profile["outputs"]))
# the event name is slightly misleading, but the message indicates that we inferred the target name for a profile
fire_event(MissingProfileTarget(profile_name=profile_name, target_name=target_name))
else:
target_name = "default"
Expand Down

0 comments on commit cd7472b

Please sign in to comment.