Skip to content

Commit

Permalink
add env DBT_PROJECT_DIR support dbt-labs#6078
Browse files Browse the repository at this point in the history
  • Loading branch information
jtcohen6 authored and leo-schick committed Feb 18, 2023
1 parent b05582d commit a4ab168
Show file tree
Hide file tree
Showing 31 changed files with 1,141 additions and 1,122 deletions.
6 changes: 6 additions & 0 deletions .changes/unreleased/Features-20230119-141156.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
kind: Features
body: add support for DBT_PROJECT_DIR env var
time: 2023-01-19T14:11:56.638325919+01:00
custom:
Author: leo-schick
Issue: "6078"
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.

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

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.

5 changes: 0 additions & 5 deletions test/integration/062_defer_state_tests/models/table_model.sql

This file was deleted.

4 changes: 0 additions & 4 deletions test/integration/062_defer_state_tests/models/view_model.sql

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.

14 changes: 0 additions & 14 deletions test/integration/062_defer_state_tests/snapshots/my_snapshot.sql

This file was deleted.

Loading

0 comments on commit a4ab168

Please sign in to comment.