Code Monkey home page Code Monkey logo

Comments (4)

melissa-ellevation avatar melissa-ellevation commented on August 22, 2024

access denied to create a PR for you all but apply_masking_policy_list_for_models.sql just needs a for loop after line 5 to fix the issue. Right now it's not looping through the nodes if operation_type = "apply".

{% macro apply_masking_policy_list_for_models(meta_key,operation_type="apply") %}

{% if execute %}

    {% if operation_type == "apply" %}

        {% for model in graph.nodes.values() %}
    
            {% set model_id = model.unique_id | string %}

from dbt-snow-mask.

entechlog avatar entechlog commented on August 22, 2024

Hello @melissa-ellevation ,

from dbt-snow-mask.

entechlog avatar entechlog commented on August 22, 2024

Hello @melissa-ellevation , Now I think more about it, this was by design. Idea was not to apply the masking policies globally by calling the apply command, rather apply them when the dbt run for the model happens. Does this make sense ? Happy to discuss more about this and see if this is still a valid bug/PR

from dbt-snow-mask.

melissa-ellevation avatar melissa-ellevation commented on August 22, 2024

@entechlog WOW ok thank you for your patience with this, I figured out why this wasn't working for me. I had "{{dbt_snow_mask.create_masking_policy('models')}}" running in on-run-end instead of as a post-hook to models and snapshots specifically.

I just updated the PR to include a note in the README, but this issue and PR can be closed whether or not you choose to add the note.

Didn't work:

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


on-run-end:
  
- "{{ dbt_snow_mask.apply_masking_policy('sources')}}"
  
- "{{ dbt_snow_mask.apply_masking_policy('models') }}"

Worked:

on-run-start:
  
- "{{ dbt_snow_mask.create_masking_policy('sources')}}"
  
on-run-end:
  
- "{{ dbt_snow_mask.apply_masking_policy('sources')}}"
  

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

Thank you for your help and I'm sorry for the confusion!

from dbt-snow-mask.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.