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

New page to explain context methods and variables available in properties YAML files #5840

Merged
merged 6 commits into from
Jul 30, 2024
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
---
title: " About properties.yml context"
sidebar_label: "properties.yml context"
id: "dbt-properties-yml-context"
description: "The context methods and variables available when configuring resources in a properties.yml file."
---

The following context methods and variables are available when configuring
resources in a `properties.yml` file.

**Available context methods:**
- [env_var](/reference/dbt-jinja-functions/env_var)
- [var](/reference/dbt-jinja-functions/var)

**Available context variables:**
- [target](/reference/dbt-jinja-functions/target)
- [builtins](/reference/dbt-jinja-functions/builtins)
- [dbt_version](/reference/dbt-jinja-functions/dbt_version)

### Example configuration

<File name='properties.yml'>

```yml
# Configure this model to be materialized as a view
# in development and a table in production/CI contexts

models:
- name: dim_customers
config:
materialized: "{{ 'view' if target.name == 'dev' else 'table' }}"
```

</File>
Loading