diff --git a/.changes/unreleased/Under the Hood-20230117-162505.yaml b/.changes/unreleased/Under the Hood-20230117-162505.yaml new file mode 100644 index 00000000000..5980bd2632a --- /dev/null +++ b/.changes/unreleased/Under the Hood-20230117-162505.yaml @@ -0,0 +1,6 @@ +kind: Under the Hood +body: dbt snapshot works in click +time: 2023-01-17T16:25:05.973769-08:00 +custom: + Author: ChenyuLInx + Issue: "5554" diff --git a/core/dbt/cli/main.py b/core/dbt/cli/main.py index 2d66733f37e..4ebcc4722cd 100644 --- a/core/dbt/cli/main.py +++ b/core/dbt/cli/main.py @@ -14,6 +14,7 @@ from dbt.task.deps import DepsTask from dbt.task.run import RunTask from dbt.task.test import TestTask +from dbt.task.snapshot import SnapshotTask # CLI invocation @@ -401,10 +402,16 @@ def seed(ctx, **kwargs): @p.threads @p.vars @requires.preflight +@requires.profile +@requires.project def snapshot(ctx, **kwargs): """Execute snapshots defined in your project""" - 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 = SnapshotTask(ctx.obj["flags"], config) + + results = task.run() + success = task.interpret_results(results) + return results, success # dbt source diff --git a/core/dbt/docs/build/doctrees/environment.pickle b/core/dbt/docs/build/doctrees/environment.pickle index 6a2d234ffe5..9c9eb6d15e3 100644 Binary files a/core/dbt/docs/build/doctrees/environment.pickle and b/core/dbt/docs/build/doctrees/environment.pickle differ diff --git a/core/dbt/docs/build/html/_static/alabaster.css b/core/dbt/docs/build/html/_static/alabaster.css index 0eddaeb07d1..517d0b29cb1 100644 --- a/core/dbt/docs/build/html/_static/alabaster.css +++ b/core/dbt/docs/build/html/_static/alabaster.css @@ -419,7 +419,9 @@ table.footnote td { } dl { - margin: 0; + margin-left: 0; + margin-right: 0; + margin-top: 0; padding: 0; } diff --git a/core/dbt/docs/build/html/genindex.html b/core/dbt/docs/build/html/genindex.html index ceac455e800..aefab024842 100644 --- a/core/dbt/docs/build/html/genindex.html +++ b/core/dbt/docs/build/html/genindex.html @@ -88,7 +88,7 @@