Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

convert 062_defer_state_tests #6616

Merged
merged 5 commits into from
Jan 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 3 additions & 9 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_argument(*subparsers):
def _add_defer_arguments(*subparsers):
for sub in subparsers:
sub.add_optional_argument_inverse(
"--defer",
Expand All @@ -499,10 +499,6 @@ def _add_defer_argument(*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 @@ -580,7 +576,7 @@ def _build_docs_generate_subparser(subparsers, base_subparser):
Do not run "dbt compile" as part of docs generation
""",
)
_add_defer_argument(generate_sub)
_add_defer_arguments(generate_sub)
return generate_sub


Expand Down Expand Up @@ -1192,9 +1188,7 @@ 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_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)
_add_defer_arguments(run_sub, test_sub, build_sub, snapshot_sub, compile_sub)
# --full-refresh
_add_table_mutability_arguments(run_sub, compile_sub, build_sub)

Expand Down
1 change: 1 addition & 0 deletions core/dbt/task/compile.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ 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()

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

3 changes: 0 additions & 3 deletions test/integration/062_defer_state_tests/macros/macros.sql

This file was deleted.

This file was deleted.

8 changes: 0 additions & 8 deletions test/integration/062_defer_state_tests/models/exposures.yml

This file was deleted.

10 changes: 0 additions & 10 deletions test/integration/062_defer_state_tests/models/schema.yml

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

3 changes: 0 additions & 3 deletions test/integration/062_defer_state_tests/seeds/seed.csv

This file was deleted.

This file was deleted.

Loading