entechlog / dbt-snow-mask

This repository contains source code for dbt package dbt_snow_mask.
https://hub.getdbt.com/entechlog/dbt_snow_mask/latest/
GNU General Public License v3.0
60 stars 25 forks source link

Applying policy on tables #65

Closed belalaboabdo closed 1 year ago

belalaboabdo commented 1 year ago

We currently have dbt_snow_mask configured in our dbt_project.yml to create masking policies for all models on run start and apply policies to run as a post-hook. When materializing a model as a table that references columns from an upstream model with a masking policy applied to it we get the following database error.

String '357715109e6a2d0c23343a5dda82be162326e4715ec69bb8f24755848739d910' is too long and would be truncated

dbt_project.yml

on-run-start:
  - "{{ dbt_snow_mask.create_masking_policy('models')}}"

vars:
  use_common_masking_policy_schema_only: "True"
  common_masking_policy_schema: "PUBLIC"

models:
  +post-hook:
    - "{{ dbt_snow_mask.apply_masking_policy('models') }}"