Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Differentiate between expressions that print and statements that don't #4546

Merged
merged 6 commits into from
Dec 18, 2023

Conversation

dbeatty10
Copy link
Contributor

@dbeatty10 dbeatty10 commented Nov 28, 2023

Preview

What are you changing in this pull request and why?

Instigated by dbt-labs/dbt-core#9113 (comment)

We want to briefly explain the differences between expressions that print out and statements that don't.

At the same time, we don't want to fully replicate all the Jinja documentation.

Here's a quick table to explain the behavioral differences between the types of delimiters ("curlies"):

Name Delimiter Executes Prints
Expression {{ ... }}
Statement {% ... %}
Comment {# ... #}

The Jinja docs for the different types of delimiters has the advantage of being brief, but lacks clarity especially as it relates to whether statements print out or not (they don't). Since the “do” aka expression-statement is an optional extension in Jinja, it isn't documented in list of control structures.

🎩

After

image

Before

image

Checklist

  • Review the Content style guide so my content adheres to these guidelines.
  • I have checked that the preview renders correctly
  • I have checked that the new links work correctly

Copy link

vercel bot commented Nov 28, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
docs-getdbt-com ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 18, 2023 8:29pm

@github-actions github-actions bot added content Improvements or additions to content size: x-small This change will take under 3 hours to fix. labels Nov 28, 2023
@dbeatty10 dbeatty10 marked this pull request as ready for review November 28, 2023 16:13
@dbeatty10 dbeatty10 requested a review from a team as a code owner November 28, 2023 16:13
@dbeatty10 dbeatty10 merged commit 69c859f into current Dec 18, 2023
7 checks passed
@dbeatty10 dbeatty10 deleted the dbeatty/jinja-statements branch December 18, 2023 20:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
content Improvements or additions to content size: x-small This change will take under 3 hours to fix.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants