Skip to content

Commit

Permalink
dbt build works in click (dbt-labs#6680)
Browse files Browse the repository at this point in the history
* build working with click
  • Loading branch information
MichelleArk authored Jan 20, 2023
1 parent 11c6222 commit 9823a56
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
6 changes: 6 additions & 0 deletions .changes/unreleased/Under the Hood-20230119-205650.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
kind: Under the Hood
body: dbt build working with new click framework
time: 2023-01-19T20:56:50.50549-05:00
custom:
Author: michelleark
Issue: "5541"
12 changes: 10 additions & 2 deletions core/dbt/cli/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
from dbt.task.list import ListTask
from dbt.task.freshness import FreshnessTask
from dbt.task.run_operation import RunOperationTask
from dbt.task.build import BuildTask


# CLI invocation
Expand Down Expand Up @@ -104,6 +105,7 @@ def cli(ctx, **kwargs):
@p.profile
@p.profiles_dir
@p.project_dir
@p.resource_type
@p.select
@p.selector
@p.show
Expand All @@ -115,10 +117,16 @@ def cli(ctx, **kwargs):
@p.vars
@p.version_check
@requires.preflight
@requires.profile
@requires.project
def build(ctx, **kwargs):
"""Run all Seeds, Models, Snapshots, and tests in DAG order"""
click.echo(f"`{inspect.stack()[0][3]}` called\n flags: {ctx.obj['flags']}")
return None, True
config = RuntimeConfig.from_parts(ctx.obj["project"], ctx.obj["profile"], ctx.obj["flags"])
task = BuildTask(ctx.obj["flags"], config)

results = task.run()
success = task.interpret_results(results)
return results, success


# dbt clean
Expand Down

0 comments on commit 9823a56

Please sign in to comment.