Skip to content

Commit

Permalink
Click snapshot as click command (#5972) (#6640)
Browse files Browse the repository at this point in the history
  • Loading branch information
ChenyuLInx authored Jan 19, 2023
1 parent 53127da commit 1913eac
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 6 deletions.
6 changes: 6 additions & 0 deletions .changes/unreleased/Under the Hood-20230117-162505.yaml
Original file line number Diff line number Diff line change
@@ -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"
11 changes: 9 additions & 2 deletions core/dbt/cli/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
Binary file modified core/dbt/docs/build/doctrees/environment.pickle
Binary file not shown.
4 changes: 3 additions & 1 deletion core/dbt/docs/build/html/_static/alabaster.css
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,9 @@ table.footnote td {
}

dl {
margin: 0;
margin-left: 0;
margin-right: 0;
margin-top: 0;
padding: 0;
}

Expand Down
2 changes: 1 addition & 1 deletion core/dbt/docs/build/html/genindex.html
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ <h3 id="searchlabel">Quick search</h3>

|
Powered by <a href="http://sphinx-doc.org/">Sphinx 6.1.3</a>
&amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.12</a>
&amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.13</a>

</div>

Expand Down
2 changes: 1 addition & 1 deletion core/dbt/docs/build/html/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -827,7 +827,7 @@ <h3 id="searchlabel">Quick search</h3>

|
Powered by <a href="http://sphinx-doc.org/">Sphinx 6.1.3</a>
&amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.12</a>
&amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.13</a>

|
<a href="_sources/index.rst.txt"
Expand Down
2 changes: 1 addition & 1 deletion core/dbt/docs/build/html/search.html
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ <h3>Related Topics</h3>

|
Powered by <a href="http://sphinx-doc.org/">Sphinx 6.1.3</a>
&amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.12</a>
&amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.13</a>

</div>

Expand Down

0 comments on commit 1913eac

Please sign in to comment.