Open jack-cook-repo opened 1 year ago
Hmm, these should be getting created as temporary tables so that this kind of clutter doesn't happen.
{% macro default___get_model_to_mock(model, suffix) %}
{{ return(make_temp_relation(model.incorporate(type='table'), suffix=suffix)) }}
{% endmacro %}
Can you confirm what dbt, dbt-bigquery, and datamocktool versions you're on?
Describe the feature
(Caveat: not sure if this functionality already exists!)
I would like to be able to write the
mock_model_relation
to a separate schema to themodel
.Currently, the
model_dmt_{timestamp}
models are showing up in our production dataset (alongsidemodel
) which are being surfaced in our BI tool. I'd like to put these into a separate schema. Happy to use thecustom_schema_name
with thegenerate_schema_name
macro if this is possible.I've done this with the seed files in
dbt_project.yml
using theseeds/dmt/schema
config in my own project.Describe alternatives you've considered
Tried a few things:
default___get_model_to_mock
macro to replacemodel
withref("dmt_schema", model.name)
models/dbt_datamocktool
indbt_project.yml
(doesn't seem to work as it's picking up the schema from the model itself which is defined in my project)generate_schema_name
to check for any models withdmt
in the name (again I think this has the same issue as above as it's picking up the schema before adding dmt + suffix) My final option here is to have a Python script run after each run of dmt to delete the tables.Additional context
Working on BigQuery
Are you interested in contributing this feature?
Happy to make the change given some pointers.