Skip to content

Commit

Permalink
Revert "Fix --favor-state flag"
Browse files Browse the repository at this point in the history
This reverts commit ccbdcba.
  • Loading branch information
jtcohen6 committed Jan 19, 2023
1 parent daf1313 commit fa9d2a0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
12 changes: 9 additions & 3 deletions core/dbt/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,7 @@ def _build_snapshot_subparser(subparsers, base_subparser):
return sub


def _add_defer_arguments(*subparsers):
def _add_defer_argument(*subparsers):
for sub in subparsers:
sub.add_optional_argument_inverse(
"--defer",
Expand All @@ -499,6 +499,10 @@ def _add_defer_arguments(*subparsers):
""",
default=flags.DEFER_MODE,
)


def _add_favor_state_argument(*subparsers):
for sub in subparsers:
sub.add_optional_argument_inverse(
"--favor-state",
enable_help="""
Expand Down Expand Up @@ -576,7 +580,7 @@ def _build_docs_generate_subparser(subparsers, base_subparser):
Do not run "dbt compile" as part of docs generation
""",
)
_add_defer_arguments(generate_sub)
_add_defer_argument(generate_sub)
return generate_sub


Expand Down Expand Up @@ -1188,7 +1192,9 @@ def parse_args(args, cls=DBTArgumentParser):
# list_sub sets up its own arguments.
_add_selection_arguments(run_sub, compile_sub, generate_sub, test_sub, snapshot_sub, seed_sub)
# --defer
_add_defer_arguments(run_sub, test_sub, build_sub, snapshot_sub, compile_sub)
_add_defer_argument(run_sub, test_sub, build_sub, snapshot_sub, compile_sub)
# --favor-state
_add_favor_state_argument(run_sub, test_sub, build_sub, snapshot_sub)
# --full-refresh
_add_table_mutability_arguments(run_sub, compile_sub, build_sub)

Expand Down
1 change: 0 additions & 1 deletion core/dbt/task/compile.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ def defer_to_manifest(self, adapter, selected_uids: AbstractSet[str]):
adapter=adapter,
other=deferred_manifest,
selected=selected_uids,
favor_state=bool(self.args.favor_state),
)
# TODO: is it wrong to write the manifest here? I think it's right...
self.write_manifest()

0 comments on commit fa9d2a0

Please sign in to comment.