-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Open
Labels
Description
Is this a new bug in dbt-core?
- I believe this is a new bug in dbt-core
- I have searched the existing issues, and I could not find an existing issue for this bug
Current Behavior
I want to document a macro using markdown, lets say the macro is left.sql
,
and I have a markdown file left.md
{% docs macro_left %}
Take the leftmost n characters of a string-column.
# Arguments
- text : string
The column holding the string, or "'any_static_text'"
- len : integer
Column holding a number, or a number. Cannot be negative.
# Example
\`\`\`sql
-- text column
select {{ left('text', 10) }} as output
-- static text
select {{ left("'any_static_text'", 10) }} as output
\`\`\`
{% enddocs %}
With the markdown file placed e.g. next to the macro, (and with the sql code block in place) dbt build will fail, complaining the macro left
cant be found. Note that in the actual markdown, the triple code tick is not escaped.
It seems that the code inthe markdown file is being compiled during build time.
Expected Behavior
I expected markdown files not to impact dbt build at all.
Steps To Reproduce
- create a markdown file
- insert some jinja - as you would to demonstrate how to use a macro
- dbt build (and most other commands) will fail
Relevant log output
Environment
- OS: macOS 15
- Python: 3.12
- dbt: 1.10.4, also tested on dbt 1.9.2
Additional Context
tested on duckdb adapter