The Problem I’m Facing
I’m struggling to access snapshots from one dbt project within another dbt project.
The Reason Behind This
I want to maintain clean lineage across projects by selectively exposing certain snapshots from one project to another.
What I’ve Tried So Far
Here are the approaches I’ve attempted:
- Using
dependencies.yml
: This works well for models, allowing me to reference public models across projects. However, it doesn’t seem to apply to snapshots, as I can’t access them in the same way. - Using Packages: I tried including the entire Git repository of one dbt project as a package in the other. However, this grants full access to the entire project, including all models and snapshots. My goal is to selectively share only specific models or snapshots.
- Adjusting Model Privacy: In the second approach, I attempted to set all models as private, keeping only the models and snapshots I wanted to expose as public. But this caused issues where public models or snapshots could no longer reference their upstream dependencies, which are private.
The Question
How can I selectively expose only the snapshots I need from one dbt project to another without sharing the entire project or disrupting the dependency flow between models?