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

[CT-708] [Bug] Incorrect usage text when running 'dbt docs' #5319

Closed
1 task done
akerone opened this issue Jun 1, 2022 · 3 comments
Closed
1 task done

[CT-708] [Bug] Incorrect usage text when running 'dbt docs' #5319

akerone opened this issue Jun 1, 2022 · 3 comments
Labels
bug Something isn't working cli

Comments

@akerone
Copy link

akerone commented Jun 1, 2022

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

If you run dbt docs, which is incorrect, the generic usage text is displayed, rather than the docs specific one.

In other words, executing dbt docs gives the same output as dbt --help

Expected Behavior

The output given should be equivalent to dbt docs --help

Steps To Reproduce

  1. On a Terminal, run dbt docs

Relevant log output

$ dbt docs
usage: dbt [-h] [--version] [-r RECORD_TIMING_INFO] [-d] [--log-format {text,json,default}] [--no-write-json] [--use-colors | --no-use-colors] [--printer-width PRINTER_WIDTH] [--warn-error]
           [--no-version-check] [--partial-parse | --no-partial-parse] [--use-experimental-parser] [--no-static-parser] [--profiles-dir PROFILES_DIR] [--no-anonymous-usage-stats] [-x]
           [--event-buffer-size EVENT_BUFFER_SIZE] [-q] [--no-print] [--cache-selected-only | --no-cache-selected-only]
           {docs,source,init,clean,debug,deps,list,ls,build,snapshot,run,compile,parse,test,seed,run-operation} ...

An ELT tool for managing your SQL transformations and data models. For more documentation on these commands, visit: docs.getdbt.com

optional arguments:
  -h, --help            show this help message and exit
  --version             Show version information
  -r RECORD_TIMING_INFO, --record-timing-info RECORD_TIMING_INFO
                        When this option is passed, dbt will output low-level timing stats to the specified file. Example: `--record-timing-info output.profile`
  -d, --debug           Display debug logging during dbt execution. Useful for debugging and making bug reports.
  --log-format {text,json,default}
                        Specify the log format, overriding the command's default.
  --no-write-json       If set, skip writing the manifest and run_results.json files to disk
  --use-colors          Colorize the output DBT prints to the terminal. Output is colorized by default and may also be set in a profile or at the command line. Mutually exclusive with --no-
                        use-colors
  --no-use-colors       Do not colorize the output DBT prints to the terminal. Output is colorized by default and may also be set in a profile or at the command line. Mutually exclusive
                        with --use-colors
  --printer-width PRINTER_WIDTH
                        Sets the width of terminal output
  --warn-error          If dbt would normally warn, instead raise an exception. Examples include --models that selects nothing, deprecations, configurations with no associated models,
                        invalid test configurations, and missing sources/refs in tests.
  --no-version-check    If set, skip ensuring dbt's version matches the one specified in the dbt_project.yml file ('require-dbt-version')
  --partial-parse       Allow for partial parsing by looking for and writing to a pickle file in the target directory. This overrides the user configuration file.
  --no-partial-parse    Disallow partial parsing. This overrides the user configuration file.
  --use-experimental-parser
                        Enables experimental parsing features.
  --no-static-parser    Disables the static parser.
  --profiles-dir PROFILES_DIR
                        Which directory to look in for the profiles.yml file. Default = /home/weasel/.dbt
  --no-anonymous-usage-stats
                        Do not send anonymous usage stat to dbt Labs
  -x, --fail-fast       Stop execution upon a first failure.
  --event-buffer-size EVENT_BUFFER_SIZE
                        Sets the max number of events to buffer in EVENT_HISTORY
  -q, --quiet           Suppress all non-error logging to stdout. Does not affect {{ print() }} macro calls.
  --no-print            Suppress all {{ print() }} macro calls.
  --cache-selected-only
                        Pre cache database objects relevant to selected resource only.
  --no-cache-selected-only
                        Pre cache all database objects related to the project.

Available sub-commands:
  {docs,source,init,clean,debug,deps,list,ls,build,snapshot,run,compile,parse,test,seed,run-operation}
    docs                Generate or serve the documentation website for your project.
    source              Manage your project's sources
    init                Initialize a new DBT project.
    clean               Delete all folders in the clean-targets list (usually the dbt_packages and target directories.)
    debug               Show some helpful information about dbt for debugging. Not to be confused with the --debug option which increases verbosity.
    deps                Pull the most recent version of the dependencies listed in packages.yml
    list (ls)           List the resources in your project
    build               Run all Seeds, Models, Snapshots, and tests in DAG order
    snapshot            Execute snapshots defined in your project
    run                 Compile SQL and execute against the current target database.
    compile             Generates executable SQL from source, model, test, and analysis files. Compiled SQL files are written to the target/ directory.
    parse               Parsed the project and provides information on performance
    test                Runs tests on data in deployed models. Run this after `dbt run`
    seed                Load data from csv files into your data warehouse.
    run-operation       Run the named macro with any supplied arguments.

Specify one of these sub-commands and you can find more help from there.

Environment

- OS: Ubuntu 20.04 (WSL2)
- Python: Python 3.8.10
- dbt: 
Core:
  - installed: 1.1.0
  - latest:    1.1.0 - Up to date!

Plugins:
  - bigquery: 1.1.0 - Up to date!


### What database are you using dbt with?

bigquery

### Additional Context

_No response_
@akerone akerone added bug Something isn't working triage labels Jun 1, 2022
@github-actions github-actions bot changed the title [Bug] Incorrect usage text when running 'dbt docs' [CT-708] [Bug] Incorrect usage text when running 'dbt docs' Jun 1, 2022
@ChenyuLInx
Copy link
Contributor

ChenyuLInx commented Jun 9, 2022

@akerone Thanks for submitting this!! And I agree that the behavior you are describing would be better user experience.
I did some initial look into the codebase and argparse and am not sure what's the best way to achieve this and think it is going to be tricky(I don't have much experience with argparse).

@jtcohen6 This kind of becomes a priority question since we are planning to revamp the CLI interface. Do you feel like we should keep exploring how to make this happen with the current framework or leave this as part of the CLI revamp?

@jtcohen6
Copy link
Contributor

@ChenyuLInx Thanks for tagging me in. I agree this ought to be better, it will be tricky to do with our current CLI. I think the right move is to wait until after our CLI revamp, and tackle this as part of the new system.

@leahwicz
Copy link
Contributor

Closing this issue out since the work is being done in issue #5528

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working cli
Projects
None yet
Development

No branches or pull requests

4 participants