For BigQuery users working with dbt
This might be useful:
Some time ago I developed a BigQuery autocleaner macro for dbt. It inspects your BigQuery datasets and removes any tables or views not declared as models in your dbt project. It also supports a dry_run flag so you can preview what would be removed before taking action.
The goal: keep your warehouse clean by automatically removing redundant or orphaned objects.
How to use it:
- Add the macro package in
your_dbt_repo/packages.yml:
packages:
- git: https://github.com/albertovpd/dbt_spice
revision: main
- Run
dbt deps
That’s it. The macro is ready to run.
This is a side project I wish I had more time to evolve.
The plan is to expand it with utilities like this, with a future focus on strong statistical and Machine Learning capabilities.
If the idea resonates with you, you’d like to contribute or you have a proposal, feel free to jump in.
Repo: https://github.com/albertovpd/dbt_spice