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

Update help text for commands + params in CLI and top-level API #7176

Merged
merged 32 commits into from
Apr 11, 2023
Merged
Show file tree
Hide file tree
Changes from 29 commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
3e2d549
Removed options for `dbt parse`
dbeatty10 Mar 16, 2023
405fe96
Fix misspellings
dbeatty10 Mar 16, 2023
322b430
Capitalize JSON when appropriate
dbeatty10 Mar 16, 2023
5b54a51
Update help text for --write-json/--no-write-json
dbeatty10 Mar 16, 2023
0d47722
Update help text for --config-dir
dbeatty10 Mar 16, 2023
9e0a0db
Update help text for --resource-types
dbeatty10 Mar 16, 2023
b94cdd6
Removed decorators for removed dbt parse options
dbeatty10 Mar 27, 2023
9938dd1
Remove `--write-manifest` flag from `parse`
dbeatty10 Mar 27, 2023
01db919
Remove `--parse-only` flag from `compile`
dbeatty10 Mar 27, 2023
0da3f99
Update help text for `dbt list --output`
dbeatty10 Mar 27, 2023
7d3213b
Standardize on one line per argument
dbeatty10 Mar 27, 2023
7632e0a
Factor 3 from 12 Factor CLI Apps
dbeatty10 Mar 27, 2023
6a443c0
Update help text for `dbt --version`
dbeatty10 Mar 27, 2023
e7f6144
Standardize capitalization of resource types for `dbt build`
dbeatty10 Mar 27, 2023
edaa1df
`debug --config-dir` is a boolean flag
dbeatty10 Mar 28, 2023
1f9eb0a
Update help text for `--version-check`
dbeatty10 Mar 28, 2023
45ec185
Specify `-q` as a conventional alias for `--quiet`
dbeatty10 Mar 28, 2023
8170ff2
Update help text for `debug --config-dir`
dbeatty10 Mar 28, 2023
a83e9b9
Update help text for `debug`
dbeatty10 Mar 28, 2023
5ee6580
Treat more dense text blobs as binary for `git grep`
dbeatty10 Apr 7, 2023
c8a686c
Update help text for `--version-check`
dbeatty10 Apr 7, 2023
599011e
Update help text for `--defer`
dbeatty10 Apr 7, 2023
308d32f
Update help text for `--indirect-selection`
dbeatty10 Apr 7, 2023
aa35c74
Co-locate log colorization with other log settings
dbeatty10 Apr 7, 2023
3097cf3
Update help text for `--log-format*`, `--log-level*`, and `--use-colo…
dbeatty10 Apr 7, 2023
8bb2cac
Merge branch 'main' into dbeatty/6546-param-help-text
dbeatty10 Apr 7, 2023
8e2ab31
Temporarily re-add option for CI tests
dbeatty10 Apr 7, 2023
2a715f4
Merge branch 'dbeatty/6546-param-help-text' of github.com:dbt-labs/db…
dbeatty10 Apr 7, 2023
e431e8c
Remove `--parse-only` flag from `show`
dbeatty10 Apr 7, 2023
156269c
Merge branch 'main' into dbeatty/6546-param-help-text
dbeatty10 Apr 11, 2023
fe0ec9c
Merge branch 'main' into dbeatty/6546-param-help-text
dbeatty10 Apr 11, 2023
5a21f3a
Remove `--write-manifest` flag from `parse` (again)
dbeatty10 Apr 11, 2023
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
3 changes: 3 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
core/dbt/include/index.html binary
tests/functional/artifacts/data/state/*/manifest.json binary
core/dbt/docs/build/html/searchindex.js binary
core/dbt/docs/build/html/index.html binary
performance/runner/Cargo.lock binary
core/dbt/events/types_pb2.py binary
9 changes: 3 additions & 6 deletions core/dbt/cli/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ def cli(ctx, **kwargs):
@requires.manifest
@requires.postflight
def build(ctx, **kwargs):
"""Run all Seeds, Models, Snapshots, and tests in DAG order"""
"""Run all seeds, models, snapshots, and tests in DAG order"""
task = BuildTask(
ctx.obj["flags"],
ctx.obj["runtime_config"],
Expand Down Expand Up @@ -273,7 +273,6 @@ def docs_serve(ctx, **kwargs):
@p.show_output_format
@p.indirect_selection
@p.introspect
@p.parse_only
@p.profile
@p.profiles_dir
@p.project_dir
Expand Down Expand Up @@ -320,7 +319,6 @@ def compile(ctx, **kwargs):
@p.show_limit
@p.indirect_selection
@p.introspect
@p.parse_only
dbeatty10 marked this conversation as resolved.
Show resolved Hide resolved
@p.profile
@p.profiles_dir
@p.project_dir
Expand Down Expand Up @@ -367,7 +365,8 @@ def show(ctx, **kwargs):
@requires.preflight
@requires.postflight
def debug(ctx, **kwargs):
"""Show some helpful information about dbt for debugging. Not to be confused with the --debug option which increases verbosity."""
"""Test the database connection and show information for debugging purposes. Not to be confused with the --debug option which increases verbosity."""

task = DebugTask(
ctx.obj["flags"],
None,
Expand Down Expand Up @@ -466,7 +465,6 @@ def list(ctx, **kwargs):
# dbt parse
@cli.command("parse")
@click.pass_context
@p.compile_parse
@p.profile
@p.profiles_dir
@p.project_dir
Expand All @@ -475,7 +473,6 @@ def list(ctx, **kwargs):
@p.threads
@p.vars
@p.version_check
@p.write_manifest
@requires.preflight
@requires.profile
@requires.project
Expand Down
109 changes: 54 additions & 55 deletions core/dbt/cli/params.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,18 +40,11 @@
default=True,
)

compile_parse = click.option(
"--compile/--no-compile",
envvar=None,
help="TODO: No help text currently available",
default=True,
)
dbeatty10 marked this conversation as resolved.
Show resolved Hide resolved

config_dir = click.option(
"--config-dir",
envvar=None,
help="If specified, DBT will show path information for this project",
type=click.STRING,
help="Show the configured location for the profiles.yml file and exit",
is_flag=True,
)

debug = click.option(
Expand All @@ -65,7 +58,7 @@
defer = click.option(
"--defer/--no-defer",
envvar="DBT_DEFER",
help="If set, defer to the state variable for resolving unselected nodes.",
help="If set, resolve unselected nodes by deferring to the manifest within the --state directory.",
)

deprecated_defer = click.option(
Expand Down Expand Up @@ -121,7 +114,7 @@
indirect_selection = click.option(
"--indirect-selection",
envvar="DBT_INDIRECT_SELECTION",
help="Select all tests that are adjacent to selected resources, even if they those resources have been explicitly selected.",
help="Choose which tests to select that are adjacent to selected resources. Eager is most inclusive, cautious is most exclusive, and buildable is in between. Empty includes no tests at all.",
type=click.Choice(["eager", "cautious", "buildable", "empty"], case_sensitive=False),
default="eager",
)
Expand All @@ -135,35 +128,49 @@
log_format = click.option(
"--log-format",
envvar="DBT_LOG_FORMAT",
help="Specify the log format, overriding the command's default.",
help="Specify the format of logging to the console and the log file. Use --log-format-file to configure the format for the log file differently than the console.",
dbeatty10 marked this conversation as resolved.
Show resolved Hide resolved
type=click.Choice(["text", "debug", "json", "default"], case_sensitive=False),
default="default",
)

log_format_file = click.option(
"--log-format-file",
envvar="DBT_LOG_FORMAT_FILE",
help="Specify the file log format, overriding the command's default and the value of --log-format.",
help="Specify the format of logging to the log file by overriding the default value and the general --log-format setting.",
type=click.Choice(["text", "debug", "json", "default"], case_sensitive=False),
default="debug",
)

log_level = click.option(
"--log-level",
envvar="DBT_LOG_LEVEL",
help="Specify the minimum severity of events that are logged.",
help="Specify the minimum severity of events that are logged to the console and the log file. Use --log-level-file to configure the severity for the log file differently than the console.",
type=click.Choice(["debug", "info", "warn", "error", "none"], case_sensitive=False),
default="info",
)

log_level_file = click.option(
"--log-level-file",
envvar="DBT_LOG_LEVEL_FILE",
help="Specify the minimum severity of events that are logged to file, overriding the value of --log-level-file.",
help="Specify the minimum severity of events that are logged to the log file by overriding the default value and the general --log-level setting.",
type=click.Choice(["debug", "info", "warn", "error", "none"], case_sensitive=False),
default="debug",
)

use_colors = click.option(
"--use-colors/--no-use-colors",
envvar="DBT_USE_COLORS",
help="Specify whether log output is colorized in the console and the log file. Use --use-colors-file/--no-use-colors-file to colorize the log file differently than the console.",
default=True,
)

use_colors_file = click.option(
"--use-colors-file/--no-use-colors-file",
envvar="DBT_USE_COLORS_FILE",
help="Specify whether log file output is colorized by overriding the default value and the general --use-colors/--no-use-colors setting.",
default=True,
)

log_path = click.option(
"--log-path",
envvar="DBT_LOG_PATH",
Expand All @@ -178,10 +185,11 @@
hidden=True,
)

# This less standard usage of --output where output_path below is more standard
output = click.option(
"--output",
envvar=None,
help="TODO: No current help text",
help="Specify the output format: either JSON or a newline-delimited list of selectors, paths, or names",
type=click.Choice(["json", "name", "path", "selector"], case_sensitive=False),
default="selector",
)
Expand Down Expand Up @@ -219,18 +227,11 @@
"--output",
"-o",
envvar=None,
help="Specify the output path for the json report. By default, outputs to 'target/sources.json'",
help="Specify the output path for the JSON report. By default, outputs to 'target/sources.json'",
type=click.Path(file_okay=True, dir_okay=False, writable=True),
default=PurePath.joinpath(Path.cwd(), "target/sources.json"),
)

parse_only = click.option(
"--parse-only",
envvar=None,
help="TODO: No help text currently available",
is_flag=True,
)

partial_parse = click.option(
"--partial-parse/--no-partial-parse",
envvar="DBT_PARTIAL_PARSE",
Expand Down Expand Up @@ -303,6 +304,7 @@

quiet = click.option(
"--quiet/--no-quiet",
"-q",
envvar="DBT_QUIET",
help="Suppress all non-error logging to stdout. Does not affect {{ print() }} macro calls.",
)
Expand All @@ -319,7 +321,7 @@
"--resource-types",
"--resource-type",
envvar=None,
help="TODO: No current help text",
help="Restricts the types of resources that dbt will include",
type=ChoiceTuple(
[
"metric",
Expand Down Expand Up @@ -350,7 +352,11 @@
"type": tuple,
}

inline = click.option("--inline", envvar=None, help="Pass SQL inline to dbt compile and show")
inline = click.option(
"--inline",
envvar=None,
help="Pass SQL inline to dbt compile and show",
)

# `--select` and `--models` are analogous for most commands except `dbt list` for legacy reasons.
# Most CLI arguments should use the combined `select` option that aliases `--models` to `--select`.
Expand All @@ -361,7 +367,9 @@
select = click.option(*select_decls, *model_decls, **select_attrs)

selector = click.option(
"--selector", envvar=None, help="The selector name to use, as defined in selectors.yml"
"--selector",
envvar=None,
help="The selector name to use, as defined in selectors.yml",
)

send_anonymous_usage_stats = click.option(
Expand All @@ -372,7 +380,10 @@
)

show = click.option(
"--show", envvar=None, help="Show a sample of the loaded data in the terminal", is_flag=True
"--show",
envvar=None,
help="Show a sample of the loaded data in the terminal",
is_flag=True,
)

# TODO: The env var is a correction!
Expand All @@ -389,13 +400,17 @@
)

skip_profile_setup = click.option(
"--skip-profile-setup", "-s", envvar=None, help="Skip interactive profile setup.", is_flag=True
"--skip-profile-setup",
"-s",
envvar=None,
help="Skip interactive profile setup.",
is_flag=True,
)

state = click.option(
"--state",
envvar="DBT_STATE",
help="If set, use the given directory as the source for json files to compare with this project.",
help="If set, use the given directory as the source for JSON files to compare with this project.",
type=click.Path(
dir_okay=True,
file_okay=False,
Expand Down Expand Up @@ -434,7 +449,10 @@
)

target = click.option(
"--target", "-t", envvar=None, help="Which target to load for the given profile"
"--target",
"-t",
envvar=None,
help="Which target to load for the given profile",
)

target_path = click.option(
Expand All @@ -452,20 +470,6 @@
type=click.INT,
)

use_colors = click.option(
"--use-colors/--no-use-colors",
envvar="DBT_USE_COLORS",
help="Specify whether log output is colorized.",
default=True,
)

use_colors_file = click.option(
"--use-colors-file/--no-use-colors-file",
envvar="DBT_USE_COLORS_FILE",
help="Specify whether log file output is colorized overriding --use-colors/--no-use-colors.",
default=True,
)

use_experimental_parser = click.option(
"--use-experimental-parser/--no-use-experimental-parser",
envvar="DBT_USE_EXPERIMENTAL_PARSER",
Expand All @@ -492,18 +496,20 @@ def _version_callback(ctx, _param, value):

version = click.option(
"--version",
"-V",
"-v",
callback=_version_callback,
envvar=None,
expose_value=False,
help="Show version information",
help="Show version information and exit",
is_eager=True,
is_flag=True,
)

version_check = click.option(
"--version-check/--no-version-check",
envvar="DBT_VERSION_CHECK",
help="Ensure dbt's version matches the one specified in the dbt_project.yml file ('require-dbt-version')",
help="If set, ensure the installed dbt version matches the require-dbt-version specified in the dbt_project.yml file (if any). Otherwise, allow them to differ.",
default=True,
)

Expand All @@ -527,13 +533,6 @@ def _version_callback(ctx, _param, value):
write_json = click.option(
"--write-json/--no-write-json",
envvar="DBT_WRITE_JSON",
help="Writing the manifest and run_results.json files to disk",
default=True,
)

write_manifest = click.option(
"--write-manifest/--no-write-manifest",
envvar=None,
help="TODO: No help text currently available",
help="Whether or not to write the manifest.json and run_results.json files to the target directory",
default=True,
)
4 changes: 2 additions & 2 deletions core/dbt/cli/requires.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,8 +234,8 @@ def wrapper(*args, **kwargs):

def manifest(*args0, write=True, write_perf_info=False):
"""A decorator used by click command functions for generating a manifest
given a profile, project, and runtime config. This also registers the adaper
from the runtime config and conditionally writes the manifest to disc.
given a profile, project, and runtime config. This also registers the adapter
from the runtime config and conditionally writes the manifest to disk.
"""

def outer_wrapper(func):
Expand Down
4 changes: 2 additions & 2 deletions tests/functional/partial_parsing/test_pp_docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ def models(self):
}

def test_remove_replace(self, project):
run_dbt(["parse", "--write-manifest"])
run_dbt(["parse"])
manifest = get_manifest(project.project_root)
doc_id = "doc.test.whatever"
assert doc_id in manifest.docs
Expand All @@ -243,7 +243,7 @@ def test_remove_replace(self, project):
rm_file(project.project_root, "models", "my_model.md")
# remove description from schema file
write_file(my_model_no_description_yml, project.project_root, "models", "my_model.yml")
run_dbt(["parse", "--write-manifest"])
run_dbt(["parse"])
manifest = get_manifest(project.project_root)
assert doc_id not in manifest.docs
# The bug was that the file still existed in manifest.files
Expand Down