All Projects → slidoapp → dbt-superset-lineage

slidoapp / dbt-superset-lineage

Licence: MIT license
Make dbt docs and Apache Superset talk to one another

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to dbt-superset-lineage

sqllineage
SQL Lineage Analysis Tool powered by Python
Stars: ✭ 348 (+480%)
Mutual labels:  lineage, data-lineage
dbt-cloud-plugin
DBT Cloud Plugin for Airflow
Stars: ✭ 35 (-41.67%)
Mutual labels:  dbt
ncbitax2lin
🐞 Convert NCBI taxonomy dump into lineages
Stars: ✭ 113 (+88.33%)
Mutual labels:  lineage
dbt-airflow-docker-compose
Execution of DBT models using Apache Airflow through Docker Compose
Stars: ✭ 76 (+26.67%)
Mutual labels:  dbt
bigquery-data-lineage
Reference implementation for real-time Data Lineage tracking for BigQuery using Audit Logs, ZetaSQL and Dataflow.
Stars: ✭ 112 (+86.67%)
Mutual labels:  data-lineage
dbt-sugar
dbt-sugar is a CLI tool that allows users of dbt to have fun and ease performing actions around dbt models
Stars: ✭ 139 (+131.67%)
Mutual labels:  dbt
awesome-dbt
A curated list of awesome dbt resources
Stars: ✭ 520 (+766.67%)
Mutual labels:  dbt
dbt ml
Package for dbt that allows users to train, audit and use BigQuery ML models.
Stars: ✭ 41 (-31.67%)
Mutual labels:  dbt
datacatalog
Data Catalog is a service for indexing parameterized, strongly-typed data artifacts across revisions. It also powers Flytes memoization system
Stars: ✭ 52 (-13.33%)
Mutual labels:  lineage
spark-utils
Utility functions for dbt projects running on Spark
Stars: ✭ 19 (-68.33%)
Mutual labels:  dbt
dbt-spotify-analytics
Containerized end-to-end analytics of Spotify data using Python, dbt, Postgres, and Metabase
Stars: ✭ 92 (+53.33%)
Mutual labels:  dbt
dbt ad reporting
Fivetran's ad reporting dbt package. Combine your Facebook, Google, Pinterest, Linkedin, Twitter, Snapchat and Microsoft advertising spend using this package.
Stars: ✭ 68 (+13.33%)
Mutual labels:  dbt
dbt-formatter
Formatting for dbt jinja-flavored sql
Stars: ✭ 37 (-38.33%)
Mutual labels:  dbt
PyRasgo
Helper code to interact with Rasgo via our SDK, PyRasgo
Stars: ✭ 39 (-35%)
Mutual labels:  dbt
dataops-platform-airflow-dbt
Build DataOps platform with Apache Airflow and dbt on AWS
Stars: ✭ 33 (-45%)
Mutual labels:  dbt
dbt-databricks
A dbt adapter for Databricks.
Stars: ✭ 115 (+91.67%)
Mutual labels:  dbt
dbt2looker
Generate lookml for views from dbt models
Stars: ✭ 119 (+98.33%)
Mutual labels:  dbt
dbt-invoke
A CLI for creating, updating, and deleting dbt property files
Stars: ✭ 42 (-30%)
Mutual labels:  dbt
dbt artifacts
A dbt package for modelling dbt metadata. https://brooklyn-data.github.io/dbt_artifacts
Stars: ✭ 119 (+98.33%)
Mutual labels:  dbt
fal
do more with dbt. fal helps you run Python alongside dbt, so you can send Slack alerts, detect anomalies and build machine learning models.
Stars: ✭ 567 (+845%)
Mutual labels:  dbt

dbt-superset-lineage

License: MIT PyPI GitHub last commit PyPI - Python Version PyPI - Format

dbt-superset-lineage

Make dbt docs and Apache Superset talk to one another

Why do I need something like this?

Odds are rather high that you use dbt together with a visualisation tool. If so, these questions might have popped into your head time to time:

  • "Could I get rid of this model? Does it get used for some dashboards? And in which ones, if yes?"
  • "It would be so handy to see all these well-maintained column descriptions when exploring and creating charts."

In case your visualisation tool of choice is Supserset, you are in luck!

Using dbt-superset-lineage, you can:

  • Add dependencies of Superset dashboards to your dbt sources and models
  • Sync column descriptions from dbt docs to Superset

This will help you:

  • Avoid broken dashboards because of deprecated or changed models
  • Choosing the right attributes without navigating back and forth between chart and documentation

Demo

The package was presented during Coalesce, the annual dbt conference, as a part of the talk From 100 spreadsheets to 100 data analysts: the story of dbt at Slido. Watch a demo in the video below.

Demo video

Installation

pip install dbt-superset-lineage

Usage

dbt-superset-lineage comes with two basic commands: pull-dashboards and push-descriptions. The documentation for the individual commands can be shown by using the --help option.

It includes a wrapper for Superset API, one only needs to provide SUPERSET_ACCESS_TOKEN/SUPERSET_REFRESH_TOKEN (obtained via /security/login) as environment variable or through --superset-access-token/superset-refresh-token option.

N.B.

  • Make sure to run dbt compile (or dbt run) against the production profile, not your development profile
  • In case more databases are used within dbt and/or Superset and there are duplicate names (schema + table) across them, specify the database through --dbt-db-name and/or --superset-db-id options
  • Currently, PUT requests are only supported if CSRF tokens are disabled in Superset (WTF_CSRF_ENABLED=False).
  • Tested on dbt v0.20.0 and Apache Superset v1.3.0. Other versions, esp. those newer of Superset, might face errors due to different underlying code and API.

Pull dashboards

Pull dashboards from Superset and add them as exposures to dbt docs with references to dbt sources and models, making them visible both separately and as dependencies.

N.B.

  • Only published dashboards are extracted.
$ cd jaffle_shop
$ dbt compile  # Compile project to create manifest.json
$ export SUPERSET_ACCESS_TOKEN=<TOKEN>
$ dbt-superset-lineage pull-dashboards https://mysuperset.mycompany.com  # Pull dashboards from Superset to /models/exposures/superset_dashboards.yml
$ dbt docs generate # Generate dbt docs
$ dbt docs serve # Serve dbt docs

Separate exposure in dbt docs

Referenced exposure in dbt docs

Push descriptions

Push column descriptions from your dbt docs to Superset as plain text so that they could be viewed in Superset when creating charts.

N.B.:

  • Run carefully as this rewrites your datasets using merged column metadata from Superset and dbt docs.
  • Descriptions are rendered as plain text, hence no markdown syntax, incl. links, will be displayed.
  • Avoid special characters and strings in your dbt docs, e.g. or <null>.
$ cd jaffle_shop
$ dbt compile  # Compile project to create manifest.json
$ export SUPERSET_ACCESS_TOKEN=<TOKEN>
$ dbt-superset-lineage push-descriptions https://mysuperset.mycompany.com  # Push descrptions from dbt docs to Superset

Column descriptions in Superset

License

Licensed under the MIT license (see LICENSE.md file for more details).

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].