Skip to content

Commit

Permalink
Add version v to macro ref (#210)
Browse files Browse the repository at this point in the history
### Summary

Add optional named parameter to macro ref.

### Description

To use model versions with dbt
(https://docs.getdbt.com/docs/collaborate/govern/model-versions#how-is-this-different-from-just-creating-a-new-model)
it is necessary to have a optional parameter v in the ref macro.

### Test Results

I tested it locally on our dremio installation

### Changelog

-   [ ] Added optional parameter v to the ref macro

### Related Issue

<!--- Link to issue where this is tracked -->

Co-authored-by: MartinKraus <martin.kraus@tiki-institut.com>
  • Loading branch information
nigl and MartinKraus authored Jan 29, 2024
1 parent dfc7564 commit 6bb880e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions dbt/include/dremio/macros/builtins/builtins.sql
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.*/

{%- macro ref(model_name) -%}
{%- set relation = builtins.ref(model_name) -%}
{%- macro ref(model_name, v=None) -%}
{%- set relation = builtins.ref(model_name, v=v) -%}
{%- if execute -%}
{%- set model = graph.nodes.values() | selectattr("name", "equalto", model_name) | list | first -%}
{%- if model.config.materialized == 'reflection' -%}
Expand Down

0 comments on commit 6bb880e

Please sign in to comment.