-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support overriding internal macros from root projects #2301
Comments
This happens because We might be able to avoid this by parsing all project macros up-front and building that into the "internal manifest". I feel a lot more comfortable with that path now that we've refactored manifest loading quite a bit. The tricky part of that is the easy path here is probably going to involve running |
Hello Jacob, I am trying to override some macros with respect to "Snapshot" materialization. As you mentioned in the above issue even though I have overwritten the macros it still reads from the core. |
@ArtiJain0688 Could you provide some more details of your implementation? Which version of dbt are you using? Which macro in the |
Hello Jeremy,
Thank you so much for your reply.
I did try again to override the already existing snapshot macro and it
worked.
I really appreciate your response on this query.
Regards,
Arti Jain
…On Wed, Mar 17, 2021 at 3:30 AM Jeremy Cohen ***@***.***> wrote:
@ArtiJain0688 <https://github.com/ArtiJain0688> Could you provide some
more details of your implementation? Which version of dbt are you using?
Which macro in the snapshot materialization are you trying to override,
and how have you gone about it? As long as you have defined a macro in your
own project with the same name as a macro in dbt-core or a dbt adapter
plugin, dbt should know to prefer yours.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#2301 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AG75MSIFH4J72MVZ4LCXMBDTECADRANCNFSM4MDINEXQ>
.
|
Describe the bug
Users should be able to override plugin-specific macros from their root project.
Steps To Reproduce
I'd expect to see log output indicating that the override macro was being used. This does not work for macros named
get_columns_in_relation
orpostgres__get_columns_in_relation
.I haven't done enough digging to know why this behavior would be different from something like
create_table_as
, but I suspect it has something to do with going through the context used by theadapter.get_*
methods.Expected behavior
Macros defined in a project should override dbt's core implementation, or the implementation provided by a dbt plugin.
The output of
dbt --version
:The text was updated successfully, but these errors were encountered: