dbt-osmosis

dbt-osmosis from z3z1ma

The dbt-osmosis utility is a tool to supercharge dbt development by providing 4 key functions.

  1. A workbench for a REPL like development experience for dbt models
  2. The ability to diff model outputs across file revisions
  3. Automation which manages generating, updating, and propagating documentation for your schema.yml files.
  4. A FastAPI dbt server which principally integrates with the VSCode dbt power user extension.

Getting Started

Prerequisites

If you haven't already, follow the initial steps of the Getting Started guide:

  1. Install Meltano
  2. Create your Meltano project

Installation and configuration

  1. Add the dbt-osmosis utility to your project using
    meltano add
    :
  2. meltano add utility dbt-osmosis
  3. Configure the dbt-osmosis settings using
    meltano config
    :
  4. meltano config dbt-osmosis set --interactive

Next steps

  1. Add dbt-<adapter> to your pip_url, ie: pip_url: dbt-osmosis dbt-bigquery

  2. Override the namespace to mirror your dbt adapter, ie: namespace: dbt_bigquery

  3. Mirror the configuration set in your dbt-<adapter> plugin. A simple copy-paste of the config: block should be sufficient.

  4. Ensure you additionally add adapter: ... to your dbt-osmosis config for the built in commands to work. ie for Bigquery, adapter: bigquery

If you run into any issues, learn how to get help.

Capabilities

This plugin currently has no capabilities defined. If you know the capabilities required by this plugin, please contribute!

Settings

The dbt-osmosis settings that are known to Meltano are documented below. To quickly find the setting you're looking for, click on any setting name from the list:

You can override these settings or specify additional ones in your meltano.yml by adding the settings key.

Please consider adding any settings you have defined locally to this definition on MeltanoHub by making a pull request to the YAML file that defines the settings for this plugin.

(adapter)

  • Environment variable: DBT_OSMOSIS_ADAPTER

This should be set to the adapter you have installed as meltano will install dbt and its profile directory into transform/<adapter> directory. We use this config option to resolve dbt profile directory.

Commands

The dbt-osmosis utility supports the following commands that can be used with
meltano invoke
:

compose

  • Equivalent to: compose --project-dir ${MELTANO_PROJECT_ROOT}/transform --profiles-dir ${MELTANO_PROJECT_ROOT}/transform/profiles/${ADAPTER}

A slimmer version of `run` used in precommit hooks

meltano invoke dbt-osmosis:compose [args...]

diff

  • Equivalent to: diff --project-dir ${MELTANO_PROJECT_ROOT}/transform --profiles-dir ${MELTANO_PROJECT_ROOT}/transform/profiles/${ADAPTER}

Diff a dbt model from git HEAD to inspect changes as you develop, requires -m [MODEL]

meltano invoke dbt-osmosis:diff [args...]

diff-cache

  • Equivalent to: diff --project-dir ${MELTANO_PROJECT_ROOT}/transform --profiles-dir ${MELTANO_PROJECT_ROOT}/transform/profiles/${ADAPTER} --temp-table

Diff a query from git HEAD to inspect changes as you develop caching the HEAD rev of the model to a schema called `dbt_diff`, requires -m [MODEL]

meltano invoke dbt-osmosis:diff-cache [args...]

run

  • Equivalent to: run --project-dir ${MELTANO_PROJECT_ROOT}/transform --profiles-dir ${MELTANO_PROJECT_ROOT}/transform/profiles/${ADAPTER}

Organizes all dbt schema yaml files and cascadingly inherits documentation to keep it DRY.

meltano invoke dbt-osmosis:run [args...]

server

  • Equivalent to: server --register-project --project-dir ${MELTANO_PROJECT_ROOT}/transform --profiles-dir ${MELTANO_PROJECT_ROOT}/transform/profiles/${ADAPTER}

Start a server exposing two primary endpoints. /compile and /run which receive POST requests and compile or run dbt SQL against your dbt profile. It is significantly faster and simpler than dbt RPC and internally does not rely on it. This server is compatible with https://github.com/innoverio/vscode-dbt-power-user providing VS code users interactive query previews via a simple ▶️ button or Cmd+Enter.

meltano invoke dbt-osmosis:server [args...]

workbench

  • Equivalent to: workbench --project-dir ${MELTANO_PROJECT_ROOT}/transform --profiles-dir ${MELTANO_PROJECT_ROOT}/transform/profiles/${ADAPTER}

Start an interactive dbt workbench. Copy and paste model code into the workbench or author a model from scratch. The workbench allows you to write dbt with instant compile-as-you-type functionality. Spin it up or tear it down as needed.

meltano invoke dbt-osmosis:workbench [args...]

Something missing?

This page is generated from a YAML file that you can contribute changes to.

Edit it on GitHub!

Looking for help?

If you're having trouble getting the dbt-osmosis utility to work, look for an existing issue in its repository, file a new issue, or join the Meltano Slack community and ask for help in the
#plugins-general
channel.

Install

meltano add utility dbt-osmosis

Maintenance Status

  • Maintenance Status
  • Stars
  • Forks
  • Open Issues
  • Open PRs
  • Contributors
  • License

Maintainer

  • Alex Butler

Meltano Stats

  • Total Executions (Last 3 Months)
  • Projects (Last 3 Months)

PyPI Stats

  • PyPI Downloads
  • PyPI Package Version

Keywords

  • dbtosmosisstreamlitfastapiyamltooling