Closed mjahammel closed 1 year ago
Haven't test it, but got the same issue and would appreciate a change.
I'm still new to dbt, but as I've learned more and more about dbt works, some light bulbs have come on. For example, this request can be accomplished without a modification to the package. Use the following in dbt_project.yml:
common_masking_policy_schema: '{{ generate_schema_name("GOVERNANCE") }}'
Currently, specifying a value for the 'common_masking_policy_schema' variable results in dbt using that value, as-is, as the target schema for the masking policies. This is different from the default dbt behaviour of prefixing the 'schema' variable from dbt_project.yml file with the value of 'schema' variable in the profiles.yml file.
I propose adding a new configuration variable, 'common_masking_policy_dbt_schema_override'. The value would be True/False. The default value would be 'True', which would cause the code to behave as it does currently (preserving backwards compatibility). If the value specified is 'False', then the dbt macro 'generate_schema_name' would be called to calculate the schema name.
I have cloned the repository and tried out changes to support this. For example, the changes to 'create_masking_policy.sql' are:
Thoughts?
I have a branch ready to be committed, if this sounds like something that would be acceptable.
Thanks,