Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions sqlmesh/dbt/builtin.py
Original file line number Diff line number Diff line change
Expand Up @@ -545,6 +545,7 @@ def create_builtin_globals(

builtin_globals["run_started_at"] = jinja_globals.get("execution_dt") or now()
builtin_globals["dbt"] = AttributeDict(builtin_globals)
builtin_globals["context"] = builtin_globals["dbt"]

return {**builtin_globals, **jinja_globals}

Expand Down
7 changes: 7 additions & 0 deletions tests/dbt/test_transformation.py
Original file line number Diff line number Diff line change
Expand Up @@ -1435,6 +1435,13 @@ def test_flags(sushi_test_project: Project):
assert context.render("{{ flags.WHICH }}") == "parse"


@pytest.mark.xdist_group("dbt_manifest")
def test_context_namespace(sushi_test_project: Project):
context = sushi_test_project.context

assert context.render("{{ context.flags.FULL_REFRESH }}") == "None"


@pytest.mark.xdist_group("dbt_manifest")
def test_relation(sushi_test_project: Project):
context = sushi_test_project.context
Expand Down