Skip toΒ content

dbt Docs Lineage: Custom Colors Demo

5 mins

Problem: I have a hard time reasoning about the hundreds of nodes within my dbt Docs lineage graph. It wastes precious headspace, and it can feel overwhelming to newcomers and maintainers. Solution: Let's color code nodes to make it delightful to reason about lineage When will this come to dbt? in v1.3 How do I get to run this on my local machine? Follow the contributing guide instructions: https://github.com/dbt-labs/dbt-core/blob/main/CONTRIBUTING.md

View Comments and Reply

Transcript

Show Transcript

Hey folks, this is some here, and I'm going to talk today about custom node colors coming to the DPT docs.

And so before I get into kind of any details here, as you're wondering, like what the heck you're looking at with this screenshot, it's figuring out what problem we're trying to solve here in the first place.

Um, there are times where you're going to have hundreds of nodes within your DPT docs, lineage, and it's really hard to reason about which ones you should care about, especially if you're a newcomer to DPT docs slash you just want at a glance of like, Hey, what are my literal bronze, silver, and gold layers within, uh, my lineage.

And then there are other use cases where it's like, Hey, like out of these, like which ones are the first things I should care about as a finance person versus a marketing person versus what have you.

And so that's why, uh, along with Ben wa and Matt, uh, we contributed to making custom note colors a reality with DBT docs.

And so with that in mind, you can literally visualize your brown, silver, and gold layers and even customize specific colors, um, within layers that you care about.

And so over here, there's going to be a link in this after this, uh, demo, but essentially you get a preview of all the configs in order to create something that looks like this, where essentially there's a whole bronze layer at a random gold layer.

And I have some overrides over here. And so it's really nice about this is that you can also have a SQL file override, a schema file, overrided project gamble, but let's get into the meat and potatoes of this.

So you see over here, I can define things at the sub folder level. And so instead of individualizing the configurations at mile, my staging models, for example, I just put a hex code or plain color name, and it takes care of cascading.

Those changes across all the models within that sub folder. I could do that at the schema level as well, or I described my tests.

I can even do it at the SQL file level as well. And what's really nice about this is that things will override as necessary, um, based off the hierarchy of configurations.

So with that in mind, let's actually see, you know, a real life demo of this. So over here, I have a project within a development branch, um, locally vs code.

I want to keep in mind here. This is very kind of experimental at this point. This is going to ship in 1.3 of DVT Corp.

Uh, and so this will not work within DVD cloud or just downloading the straight DPT version. You're going to have to hack and slash a bit.

And so if you have questions about that, feel free to reach out to me in the comments or on the DVD, public slack.

But overall, I'm just defining a couple of things here, whether it's red here. If I go to my project, Gammel over here, I define things at the self folder level as well.

All I have to do is run a command that like this, It's going to look at all my configs and compile them into something that's usable for DBT docs.

And then afterwards, I can serve them up in my local browser. I'm gonna do this DVT doc surf, and then we'll see where we go from here.

And Suzanne, there's the read me I expect, but here is also a nice little lineage with all the colors and scope that I care about.

You notice here, there some great outlines here. You're probably wondering how did I define this? What's really nice is kind of an added benefit that comes with no colors is that now you can hide models within DBT packages, if they aren't relevant to your lineage and they'll gray them out over here.

Let me show you an example here. If I view the documentation, it'll say this model is hidden. And so you're probably wondering how the heck do I configure something like that.

I just go up here and where the heck is that guy? Oh, right here. Just docs show false. And this is that's all you have to do.

And you also probably wondering like, Hey, what if I accidentally fat finger a wrong color? How does it prevent me from making those kinds of mistakes?

I'll show you if our types in gibberish that looks like this, I need to TBT docs generate it. Just show me some error logs and tell me how to fix that.

Shizam something like this that wasn't allowed. Oops. So Sam just replaced that with blue and I'm good to go. And that's it.

I hope you have a really great time customizing the colors of your DBT docs lineage, and then feel free to send me a screenshot.

And who knows you may be part of the official docs one day. All right. That's it. Peace.

Transcript

More than 21 million people across 200,000 companies choose Loom

My teammates and I love using Loom! It has saved us hundreds of hours by creating informative video tutorials instead of long emails or 1-on-1 trainings with customers.
Erica Goodell

Erica GoodellCustomer Success, Pearson

Loom creates an ongoing visual and audible experience across our business and enables our employees to feel part of a unified culture and company.
Tyson Quick

Tyson QuickCEO, Postclick

My new daily email habit. Begin writing an email. Get to the second paragraph and think 'what a time suck.' Record a Loom instead. Feel like 😎.
Kieran Flanagan

Kieran FlanaganVP of Marketing, HubSpot

Loom amplifies my communication with the team like nothing else has. It's a communication tool that should be in every executive's toolbox.
David Okuinev

David OkuinevCo-CEO, Typeform

My teammates and I love using Loom! It has saved us hundreds of hours by creating informative video tutorials instead of long emails or 1-on-1 trainings with customers.
Erica Goodell

Erica GoodellCustomer Success, Pearson

Loom creates an ongoing visual and audible experience across our business and enables our employees to feel part of a unified culture and company.
Tyson Quick

Tyson QuickCEO, Postclick