Skip to content

Commit

Permalink
macros update
Browse files Browse the repository at this point in the history
  • Loading branch information
zoltanctoth committed Mar 4, 2024
1 parent a75d996 commit 5d47d50
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
6 changes: 6 additions & 0 deletions dbtlearn/macros/logging.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{% macro learn_logging() %}
{{ log("Call your mom!") }}
{{ log("Call your dad!", info=True) }} --> Logs to the screen, too
-- {{ log("Call your dad!", info=True) }} --> This will be put to the screen
{% log("Call your dad!", info=True) %} --> This won't be executed
{% endmacro %}
14 changes: 14 additions & 0 deletions dbtlearn/macros/variables.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{% macro learn_variables() %}

{% set your_name_jinja = "Zoltan" %}
{{ log("Hello " ~ your_name_jinja, info=True) }}

{{ log("Hello dbt user " ~ var("user_name", "NO USERNAME IS SET!!") ~ "!", info=True) }}

{% if var("in_test", False) %}
{{ log("In test", info=True) }}
{% else %}
{{ log("NOT in test", info=True) }}
{% endif %}

{% endmacro %}

0 comments on commit 5d47d50

Please sign in to comment.