dbt-labs / dbt-labs/docs.getdbt.com

[Core] Explain how using the `graph` does (or doesn't!) affect the visualization of the DAG

Open
#6,027 0 comments 0 reactions 0 assignees View on GitHub
content dbt Core size: large
Dominant language
JavaScript
Stars
215
Forks
1.2k
Avg merge
1d 15h
Merged PRs (30d)
130

Description

### Link to the page(s) on docs.getdbt.com requiring updates

Maybe one or both of:
- https://docs.getdbt.com/reference/dbt-jinja-functions/graph
- https://docs.getdbt.com/reference/dbt-jinja-functions/execute

### Tell us more about this update

The big idea is that there's a scenario in which a node can be missing in the visualization of the DAG in dbt Explorer but actually work as intended when building a dbt model. But it's actually not a bug! 🤯

i.e., the compiled query reflects all the intended references but the generated docs is missing some or all.

One of the ways this can happen is when using the `graph` in the transformation code for a model (like [here](https://github.com/dbt-labs/dbt-core/issues/10665)).

In that scenario, users can compile and run models that use `ref` and `source` macros but without those references being reflected in the visualization of the DAG in dbt Explorer or the generated documentation website.

This can be surprising, so we want to explain it the best we can.

---

A suggested improvement would be to show or discuss an example similar to https://github.com/dbt-labs/dbt-core/issues/10665, either within the [`graph`](https://docs.getdbt.com/reference/dbt-jinja-functions/graph) or [`execute`](https://docs.getdbt.com/reference/dbt-jinja-functions/execute) documentation pages.

And/or add a section that could illustrate all the caveats of `graph` (by comparing when `execute==False` and `execute==True`).

### Reviewers/Stakeholders/SMEs

Dougie Fresh 😎

### Related GitHub issues

https://github.com/dbt-labs/dbt-core/issues/10665

### Additional information

_No response_

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.