You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When running dbt source freshness, why does the definition of collect_freshness in a package silently take precedence over the global/default version in dbt-core, without the end user / root project "opting into" the override?
But the real question here is around the macro resolver for collect_freshness, so I think Language team is best positioned to weigh in. For all other "built-in" macros (ones defined in the global project), only the root project can override them, or explicitly opt into a dispatch order (docs) that prefers macros from packages.
Reproduction case
Create a source for a nonexistent table in your project:
github-actionsbot
changed the title
Unexpected macro resolution order for collect_freshness macro
[CT-527] Unexpected macro resolution order for collect_freshness macro
Apr 21, 2022
This issue has been marked as Stale because it has been open for 180 days with no activity. If you would like the issue to remain open, please remove the stale label or comment on the issue, or it will be closed in 7 days.
Although we are closing this issue as stale, it's not gone forever. Issues can be reopened if there is renewed community interest; add a comment to notify the maintainers.
Split off from #4525
When running
dbt source freshness
, why does the definition ofcollect_freshness
in a package silently take precedence over the global/default version indbt-core
, without the end user / root project "opting into" the override?These codepaths are in execution/adapter land:
dbt-core/core/dbt/task/freshness.py
Line 145 in 979e1c7
dbt-core/core/dbt/adapters/base/impl.py
Lines 1005 to 1006 in 979e1c7
But the real question here is around the macro resolver for
collect_freshness
, so I think Language team is best positioned to weigh in. For all other "built-in" macros (ones defined in the global project), only the root project can override them, or explicitly opt into adispatch
order (docs) that prefers macros from packages.Reproduction case
Create a source for a nonexistent table in your project:
Run
dbt source freshness
, fails because the table doesn't exist.Create a local package with
macros/collect_freshness.sql
:Add that local package in
packages.yml
:Run
dbt source freshness
, it passes—even though the end user never opted into the override.Expected behavior
The user could override
collect_freshness
in their own project, to point to the package version instead:Or rearrange dispatch order to prefer candidate macros from the
fivetran_utils
package:The text was updated successfully, but these errors were encountered: