GithubHelp home page GithubHelp logo

dbt_helpers's Introduction

dbt_helpers

Installation

Add to your packages.yml file:

# packages.yml
packages:
  - git: "https://github.com/dbt-labs/dbt_helpers"
    revision: 0.1

Run the following:

dbt deps

Macros

clean_workspace

Adapted from dbt_workspace to work on databricks.

dbt run-operation clean_workspace

Databricks / Spark

Uses the show schemas syntax to list schemas that match a regex pattern.

Args:

  • dry_run (bool, default True):
    • Dry run flag. If True, will simply print out matching schemas. If False, will drop matching schemas.
  • schemas_like (string, default None):
    • Case-insensitive regex pattern to search for. Note that with databricks, this is a regex, so to match a schema with the name dbt_cloud_pr_123, we would use the string "dbt_cloud_pr*" and not "dbt_cloud_pr%".

Examples:

dbt run-operation clean_workspace --args '{schema_like: "dbt_cloud_pr*"}'
# Prints out schemas that match the regex pattern above - e.g. "dbt_cloud_pr_123", "dbt_cloud_pr_test_123".

dbt run-operation clean_workspace --args '{schema_like: "dbt_cloud_pr*", dry_run: False}'
# Drops schemas that match the regex pattern above.

dbt_helpers's People

Contributors

jeremyyeo avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.