How to customize macros in dbt packages within the CodeGen

The best approach is to override them in your own project. Copy the macro from the package into your project’s macros directory, keeping the same name. Then modify it as needed.

Make sure your project’s version takes precedence by adjusting the dbt_project.yml file if necessary. If you’re dealing with dependencies, you can reference the original macro using packages.<package_name>.macro_name inside your override.

1 Like