Hi team is there a way in dbt to override an eleme...
# community-support
j
Hi team is there a way in dbt to override an elementary macro? I am familiar with dbt overrides and created one, but it doesn't get called and the original ..../dbt_packages/elementary/macros/... version does instead.
m
Hey @Jordan Williford, The tl;dr is we use
elementary.<macro_name>
in the package code to prevent overriding. This means that instead of going through the default priorities of dbt, the macro used is explicitly our macro. If you want to override you will need to change the macro in your local deployment of elementary.... Could you share what you are trying to change? (Also if you are interested - the dbt priorities for macros don't work well for packages. The order is user macros -> dbt macros -> packages in random order. This caused two issues for us - we couldn't override dbt macros without explicitly calling the macro from elementary, and we had collisions with other packages using the same macro names)
j
Thanks for the info. I am trying to use dispatching to override insert_data_monitoring_metrics and insert_rows in order to support sending records to a GCP cloud function instead of doing inserts, which BQ does not handle well at scale. I tried using our forked git repo for our elementary package with changed versions of those macros, but it does not work, so the override method is next.
Note that I am also attempting to override the elementary namespace macro calls of the two before-mentioned macros with this config level setting in dbt_project.yml: