Skip to content

Fix: ensure root package is treated top-level in dbt#5290

Merged
georgesittas merged 1 commit intomainfrom
jo/track_top_level_packages_correctly
Sep 3, 2025
Merged

Fix: ensure root package is treated top-level in dbt#5290
georgesittas merged 1 commit intomainfrom
jo/track_top_level_packages_correctly

Conversation

@georgesittas
Copy link
Contributor

@georgesittas georgesittas commented Sep 3, 2025

The added test demonstrates what this PR aims to support. Basically:

  • The root project specifies a macros directory in dbt_project.yml that lives within dbt_packages/
  • Another package in that directory references said macro without qualifying it with its package name

The above works in dbt, but SQLMesh didn't support it until now because an assumption was made that each package could only see the contents defined within it, not outside of it. So, the package in the 2nd bullet above would fail to see the aforementioned macro and fail at render time, since the symbol wasn't present in jinja_env.globals.

@georgesittas georgesittas requested review from a team and izeigerman September 3, 2025 17:32
@georgesittas georgesittas enabled auto-merge (squash) September 3, 2025 17:44
@georgesittas georgesittas force-pushed the jo/track_top_level_packages_correctly branch from 1c59608 to ecfbb29 Compare September 3, 2025 17:47
@georgesittas georgesittas enabled auto-merge (squash) September 3, 2025 18:12
@georgesittas georgesittas merged commit be40445 into main Sep 3, 2025
35 of 36 checks passed
@georgesittas georgesittas deleted the jo/track_top_level_packages_correctly branch September 3, 2025 18:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants