diff --git a/cosmos/operators/local.py b/cosmos/operators/local.py index 57379c7ba..6eea764ad 100644 --- a/cosmos/operators/local.py +++ b/cosmos/operators/local.py @@ -247,8 +247,8 @@ def run_command( logger.info("Outlets: %s", outlets) self.register_dataset(inlets, outlets) - self.exception_handling(result) self.store_compiled_sql(tmp_project_dir, context) + self.exception_handling(result) if self.callback: self.callback(tmp_project_dir) @@ -398,7 +398,7 @@ class DbtSeedLocalOperator(DbtLocalBaseOperator): ui_color = "#F58D7E" - template_fields: Sequence[str] = DbtBaseOperator.template_fields + ("full_refresh",) # type: ignore[operator] + template_fields: Sequence[str] = DbtLocalBaseOperator.template_fields + ("full_refresh",) # type: ignore[operator] def __init__(self, full_refresh: bool = False, **kwargs: Any) -> None: self.full_refresh = full_refresh @@ -437,7 +437,7 @@ class DbtRunLocalOperator(DbtLocalBaseOperator): ui_color = "#7352BA" ui_fgcolor = "#F4F2FC" - template_fields: Sequence[str] = DbtBaseOperator.template_fields + ("full_refresh",) # type: ignore[operator] + template_fields: Sequence[str] = DbtLocalBaseOperator.template_fields + ("full_refresh",) # type: ignore[operator] def __init__(self, full_refresh: bool = False, **kwargs: Any) -> None: self.full_refresh = full_refresh diff --git a/tests/operators/test_local.py b/tests/operators/test_local.py index 38863620f..b0a36b335 100644 --- a/tests/operators/test_local.py +++ b/tests/operators/test_local.py @@ -423,8 +423,8 @@ def test_calculate_openlineage_events_completes_openlineage_errors(mock_processo @pytest.mark.parametrize( "operator_class,expected_template", [ - (DbtSeedLocalOperator, ("env", "vars", "full_refresh")), - (DbtRunLocalOperator, ("env", "vars", "full_refresh")), + (DbtSeedLocalOperator, ("env", "vars", "compiled_sql", "full_refresh")), + (DbtRunLocalOperator, ("env", "vars", "compiled_sql", "full_refresh")), ], ) def test_dbt_base_operator_template_fields(operator_class, expected_template):