-
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
[CT-3430] [Feature] dbt should tell me if a custom macro in my project overrides one in the global project or my adapter #9164
Comments
Dragons, indeed 🐉 -- thanks for raising this @dataders.
[Updated above to reflect that Some other questions:
|
It is of course a feature that users can override/reimplement global macros, as a way to plug into & change the behavior of I agree there ought to be a better & clearer way for a user to say: "I know what I'm doing, and I mean to be doing it." If we start raising a warning, we also need:
|
Here's a thread of someone who got burned by this, because a developer predating them changed the macro's behaviour. It makes sense to be able to suppress the warnings in day to day use, but maybe |
From refinement:
|
From discussion with @graciegoheen @MichelleArk @dbeatty10 the other day: Having only one warning that's either "on" or "silenced" doesn't feel granular enough. If I've silenced the warning, I don't find out about any new collisions! I think there are two stories here:
Ideas:
{% macro global current_timestamp() %}
...
{% macro dbt.current_timestamp() %}
... What about "global" macros that are redefined in packages, if I've given that package dispatch rights over the |
Partially resolved by: #9981, which addresses the materialization macros component of this feature request and the will go out in 1.8 and will also be backported to 1.6 and 1.7. |
Hi all, sorry that I kept missing this issue. Just did some digging in on the issue and came to the following conclusion:
Any thoughts on which step we want to get to in this issue? |
Thanks for the deep dive @ChenyuLInx! 🤩 If we can only get these two things done, that would be better than nothing:
Then we could create a separate issue to refine the user experience and technical implementation for these pieces:
Although not the full desired end state, the reason that splitting this seems okay to me:
@jtcohen6 and @graciegoheen How would you feel about splitting this along those lines? Would that be acceptable, or do you feel strongly that it should be all-or-nothing in relation to the granularity of silencing on a macro-by-macro basis? If we do split this into separate issues, we could recommend not silencing this warning unless they'd accept not being warned about any new collisions. |
talked during estimation: we want to create an opt-in flag to warn about what project root/adapter macros are overwritten by the user. |
Is this your first time submitting a feature request?
Describe the feature
today, users can name custom macros whatever they like, even using the same names as those defined within dbt-core's global project! We call that overriding, and laud it as a feature rather than a bug.
However, there be dragons here. One way to keep the dragons at bay would for dbt to at least warn in stdout that there exists a name collision and that a core macro is being overridden.
Describe alternatives you've considered
disallow use of reserved macro names entirely?
Who will this benefit?
dbt-core#8753 is one example.
@danielmcauley shared another in a #db-snowflake thread where when upgrading from 1.5 to 1.7 he discovers that the root cause is that their project contains a
drop_table()
macro that now in 1.7 is now overriding a newly introduced global project macro.Are you interested in contributing this feature?
sure
Anything else?
No response
The text was updated successfully, but these errors were encountered: