Skip to content

Commit

Permalink
don't rely on config.flags being available
Browse files Browse the repository at this point in the history
  • Loading branch information
mikealfare committed Aug 29, 2024
1 parent 2631fbf commit 299ef1e
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions dbt/adapters/base/impl.py
Original file line number Diff line number Diff line change
Expand Up @@ -298,9 +298,15 @@ def behavior(self) -> Behavior:
return self._behavior

@behavior.setter
def behavior(self, raw_behavior_flags: List[BehaviorFlag]) -> None:
raw_behavior_flags.extend(self._behavior_extra)
self._behavior = Behavior(raw_behavior_flags, self.config.flags)
def behavior(self, flags: List[BehaviorFlag]) -> None:
flags.extend(self._behavior_extra)
try:
# we don't always get project flags, for example during `dbt debug`
user_overrides = self.config.flags
except AttributeError:
# in that case, take the defaults
user_overrides = {}
self._behavior = Behavior(flags, user_overrides)

@property
def _behavior_extra(self) -> List[BehaviorFlag]:
Expand Down

0 comments on commit 299ef1e

Please sign in to comment.