diff --git a/providers/dbt/core/operators.py b/providers/dbt/core/operators.py index a7e855c465..c3968cf05e 100644 --- a/providers/dbt/core/operators.py +++ b/providers/dbt/core/operators.py @@ -230,3 +230,26 @@ def execute(self, context: Context): cmd = self.build_command() + self.add_cmd_flags() + target_flag result = self.run_command(cmd=cmd, env=env) return result.output + + +class DBTSeedOperator(DBTBaseOperator): + def __init__(self, full_refresh: bool = False, **kwargs) -> None: + self.full_refresh = full_refresh + super().__init__(**kwargs) + + def add_cmd_flags(self): + flags = [] + if self.full_refresh is True: + flags.append("--full-refresh") + + return flags + + def execute(self, context: Context): + self.base_cmd = "seed" + self.create_default_profiles() + profile, profile_vars = self.map_profile() + env = self.get_env(context) | profile_vars + target_flag = ["--profile", profile] + cmd = self.build_command() + self.add_cmd_flags() + target_flag + result = self.run_command(cmd=cmd, env=env) + return result.output