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

Click snapshot as click command (#5972) #6640

Merged
merged 4 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
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