From 138a4ca8259356bc196d700dfb5b1276df5a3bb5 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Fri, 27 Oct 2023 16:11:32 +0100 Subject: [PATCH] adding new updates --- .../docs/docs/cloud/cloud-cli-installation.md | 63 +++++++++++-------- website/docs/reference/commands/clone.md | 17 +++++ website/docs/reference/dbt-commands.md | 8 +-- 3 files changed, 57 insertions(+), 31 deletions(-) diff --git a/website/docs/docs/cloud/cloud-cli-installation.md b/website/docs/docs/cloud/cloud-cli-installation.md index 179af745685..31db1408983 100644 --- a/website/docs/docs/cloud/cloud-cli-installation.md +++ b/website/docs/docs/cloud/cloud-cli-installation.md @@ -34,7 +34,7 @@ The dbt Cloud CLI is available in all [deployment regions](/docs/cloud/about-clo You can install the dbt Cloud CLI on the command line by using one of these methods.
-View a video tutorial for a step-by-step guide to installing +View a video tutorial for a step-by-step guide to installation. @@ -145,43 +145,47 @@ Advanced users can configure multiple projects to use the same Cloud CLI executa +If you already have dbt Core installed, you can install the dbt Cloud CLI using pip. Here are some considerations: + +- **Prevent conflicts**
+ To prevent overwriting dbt Core, avoid installing the dbt Cloud CLI with `pip`. Instead, consider using the native installation method (Homebrew) and configure your PATH or create a new virtual environment.
+- **Use both dbt Cloud CLI and dbt Core**
+ Have both the dbt Cloud CLI and dbt Core installed simultaneously to meet your needs. To avoid conflicts, alias the dbt Cloud CLI as "dbt-cloud." For more details, check the [FAQs](#faqs) if your operating system experiences path conflicts.
+- **Switch from the dbt Cloud CLI to dbt Core**
+ If you've already installed the dbt Cloud CLI and need to switch back to dbt Core: + - Uninstall the dbt Cloud CLI using the command: `pip uninstall dbt` + - Reinstall dbt Core using the following command, replacing "adapter_name" with the appropriate adapter name: + ```shell + pip install dbt-adapter_name --force-reinstall + ``` + For example, if I used Snowflake as an adapter, I would run: `pip install dbt-snowflake --force-reinstall` -:::info Use native packages or a virtual environment to prevent dbt Core conflicts - -To prevent overwriting dbt Core, avoid installing the dbt Cloud CLI with pip. Instead, consider using the native installation method and configuring your PATH or create a new virtual environment. - -If you've already installed the dbt Cloud CLI and need to switch back to dbt Core, uninstall the dbt Cloud CLI, and follow the dbt Core installation instructions. - -You can also have both dbt Cloud CLI and dbt Core installed simultaneously. To avoid conflicts, alias the dbt Cloud CLI as `dbt-cloud`. For more details, check the [FAQs](#faqs) if your operating system experiences path conflicts. -::: - +-------- Before installing the dbt Cloud CLI, make sure you have Python installed and your virtual environment venv or pyenv . If you already have a Python environment configured, you can skip to the [pip installation step](#install-dbt-cloud-cli-in-pip). - ### Install a virtual environment We recommend using virtual environments (venv) to namespace `cloud-cli`. -1. Create a new venv: +1. Create a new virtual environment named "dbt-cloud" with this command: ```shell python3 -m venv dbt-cloud ``` -2. Activate the virtual environment each time you create a shell window or session: - ```shell - source dbt-cloud/bin/activate # activate the environment for Mac and Linux OR - dbt-env\Scripts\activate # activate the environment for Windows - ``` +2. Activate the virtual environment each time you create a shell window or session, depending on your operating system: + + - For Mac and Linux, use: `source dbt-cloud/bin/activate`
+ - For Windows, use: `dbt-env\Scripts\activate` -3. (Mac and Linux only) Create an alias to activate your dbt environment with every new shell window or session. You can add the following to your shell's configuration file (for example, $HOME/.bashrc, $HOME/.zshrc) while replacing `` with the path to your virtual environment configuration: +3. (Mac and Linux only) Create an alias to activate your dbt environment with every new shell window or session. You can add the following to your shell's configuration file (for example, `$HOME/.bashrc, $HOME/.zshrc`) while replacing `` with the path to your virtual environment configuration: ```shell alias env_dbt='source /bin/activate' ``` - + ### Install dbt Cloud CLI in pip -1. (Optional) If you already have dbt Core installed, this installation will override that package. Note your dbt Core version in case you need to reinstall it later: +1. (Optional) If you already have dbt Core installed, this installation will override that package. Check your dbt Core version in case you need to reinstall it later by running the following command : ```bash dbt --version @@ -193,22 +197,23 @@ We recommend using virtual environments (venv) to namespace `cloud-cli`. pip3 install dbt ``` -3. (Optional) To revert back to dbt Core, first uninstall both the dbt Cloud CLI and dbt Core -4. Reinstall dbt Core using the version from Step 2. +3. (Optional) To revert back to dbt Core, first uninstall both the dbt Cloud CLI and dbt Core. Then reinstall dbt Core using the version from Step 1. ```bash pip3 uninstall dbt-core dbt pip3 install dbt-core==VERSION ``` -4. After you've verified the installation, [configure](/docs/cloud/configure-cloud-cli) the dbt Cloud CLI for your dbt Cloud project and use it to run [dbt commands](/reference/dbt-commands) similar to dbt Core. For example, execute `dbt compile` to compile a project using dbt Cloud and validate your models and tests. +4. After you've verified the installation, [configure](/docs/cloud/configure-cloud-cli) the dbt Cloud CLI for your dbt Cloud project. You can then use it to run [dbt commands](/reference/dbt-commands) similar to dbt Core. For example, execute `dbt compile` to compile a project using dbt Cloud and validate your models and tests. * If you're using the dbt Cloud CLI, you can connect to your data platform directly in the dbt Cloud interface and don't need a [`profiles.yml`](/docs/core/connect-data-platform/profiles.yml) file locally on your machine.
+ + ## Update dbt Cloud CLI The following instructions explain how to update the dbt CLoud CLI to the latest version depending on your operating system. @@ -246,6 +251,11 @@ To update: +## dbt Cloud CLI extensions +Command line extensions are additional functionalities that you can add to a command line tool or shell environment. These extensions expand the capabilities of the CLI, making it more versatile and efficient. + +The dbt Cloud CLI doesn't currently support extensions, such as SQLFluff or dbt-power-user, during the public preview period. This is because..... + ## FAQs
@@ -261,11 +271,10 @@ For compatibility, both the dbt Cloud CLI and dbt Core are invoked by running pip3 install dbt [pip](/docs/cloud/cloud-cli-installation?install=pip#install-dbt-cloud-cli) command, or +- Install natively, however ensure you deactivate your Python environment or uninstall it using `pip uninstall dbt` before proceeding. -3. (Advanced users) Install natively, but modify the $PATH environment variable to correctly point to the dbt Cloud CLI binary to use both dbt Cloud CLI and dbt Core together. +1. (Advanced users) Install natively, but modify the $PATH environment variable to correctly point to the dbt Cloud CLI binary to use both dbt Cloud CLI and dbt Core together. You can always uninstall the dbt Cloud CLI to return to using dbt Core.
diff --git a/website/docs/reference/commands/clone.md b/website/docs/reference/commands/clone.md index ea3e570447d..0a6d32de858 100644 --- a/website/docs/reference/commands/clone.md +++ b/website/docs/reference/commands/clone.md @@ -16,6 +16,7 @@ The `clone` command is useful for: - handling incremental models in dbt Cloud CI jobs (on data warehouses that support zero-copy cloning tables) - testing code changes on downstream dependencies in your BI tool + ```bash # clone all of my models from specified state to my target schema(s) dbt clone --state path/to/artifacts @@ -37,3 +38,19 @@ Unlike deferral, `dbt clone` requires some compute and creation of additional ob For example, by creating actual data warehouse objects, `dbt clone` allows you to test out your code changes on downstream dependencies _outside of dbt_ (such as a BI tool). As another example, you could `clone` your modified incremental models as the first step of your dbt Cloud CI job to prevent costly `full-refresh` builds for warehouses that support zero-copy cloning. + +## Cloning in dbt Cloud + +You can clone nodes between states in dbt Cloud using the `dbt clone` command. This is available in the [dbt Cloud IDE](/docs/cloud/dbt-cloud-ide/develop-in-the-cloud) and the [dbt Cloud CLI](/docs/cloud/cloud-cli-installation) and relies on the [`--defer`](/reference/node-selection/defer) feature. For more details on defer in dbt Cloud, read [Using defer in dbt Cloud](/docs/cloud/about-cloud-develop-defer). + +- **Using dbt Cloud CLI** — The `dbt clone` command in the dbt Cloud CLI automatically includes the `--defer` flag. This means you can use the `dbt clone` command in the dbt Cloud CLI without any additional setup. + +- **Using dbt Cloud IDE** — To use the `dbt clone` command in the dbt Cloud IDE, follow these steps before running the `dbt clone` command: + + - Set up your **Production environment** and have a successful job run. + - Enable **Defer to production** by toggling the switch in the lower-right corner of the command bar. + + - Run the `dbt clone` command from the command bar. + + + diff --git a/website/docs/reference/dbt-commands.md b/website/docs/reference/dbt-commands.md index 1448d9849d3..587ad7687ac 100644 --- a/website/docs/reference/dbt-commands.md +++ b/website/docs/reference/dbt-commands.md @@ -11,7 +11,7 @@ The following sections outline the commands supported by dbt and their relevant ### Available commands - + All commands in the table are compatible with either the dbt Cloud IDE, dbt Cloud CLI, or dbt Core. @@ -22,9 +22,9 @@ You can run dbt commands in your specific tool by prefixing them with `dbt`. Fo | [build](/reference/commands/build) | Build and test all selected resources (models, seeds, snapshots, tests) | All | All [supported versions](/docs/dbt-versions/core) | | cancel | Cancels the most recent invocation.| dbt Cloud CLI | Requires [dbt v1.6 or higher](/docs/dbt-versions/core) | | [clean](/reference/commands/clean) | Deletes artifacts present in the dbt project | All | All [supported versions](/docs/dbt-versions/core) | -| [clone](/reference/commands/clone) | Clone selected models from the specified state | dbt Cloud CLI
dbt Core | Requires [dbt v1.6 or higher](/docs/dbt-versions/core) | +| [clone](/reference/commands/clone) | Clone selected models from the specified state | All | Requires [dbt v1.6 or higher](/docs/dbt-versions/core) | | [compile](/reference/commands/compile) | Compiles (but does not run) the models in a project | All | All [supported versions](/docs/dbt-versions/core) | -| [debug](/reference/commands/debug) | Debugs dbt connections and projects | dbt Core | All [supported versions](/docs/dbt-versions/core) | +| [debug](/reference/commands/debug) | Debugs dbt connections and projects | All | All [supported versions](/docs/dbt-versions/core) | | [deps](/reference/commands/deps) | Downloads dependencies for a project | All | All [supported versions](/docs/dbt-versions/core) | | [docs](/reference/commands/cmd-docs) | Generates documentation for a project | All | All [supported versions](/docs/dbt-versions/core) | | help | Displays help information for any command | dbt Core
dbt Cloud CLI | All [supported versions](/docs/dbt-versions/core) | @@ -43,7 +43,7 @@ You can run dbt commands in your specific tool by prefixing them with `dbt`. Fo
- + Select the tabs that are relevant to your development workflow. For example, if you develop in the dbt Cloud IDE, select **dbt Cloud**.