Skip to content

Instantly share code, notes, and snippets.

@gshotwell
Created January 29, 2025 20:53
Show Gist options
  • Save gshotwell/31f7edd3b1d053818cb73df2a79f09f8 to your computer and use it in GitHub Desktop.
Save gshotwell/31f7edd3b1d053818cb73df2a79f09f8 to your computer and use it in GitHub Desktop.
---
title: A dbt model
---
```{python}
#| echo: false
sql_path = "my_path.sql"
```
## Columns
```{python}
# | echo: false
import os
os.chdir("..")
from reactable import Reactable, embed_css
from helpers import read_dbt_column_docs
embed_css()
Reactable(
read_dbt_column_docs(sql_path),
default_page_size=20,
searchable=True,
filterable=True,
)
```
## SQL code
```{python}
# | output: asis
# | echo: false
from helpers import read_sql
read_sql(sql_path)
```
@gshotwell
Copy link
Author

In an ideal world I would have something like:

document_model("sql_path) which I could call in other documents.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment