Open kokorin opened 5 months ago
I think you would need to replicate the dynamism in the osmosis config.
vars:
dbt-osmosis:
dev: "{{ 'staging/_dev_sources.yml' if target.name == 'dev' else None }}"
prod: "{{ 'staging/_prod_sources.yml' if target.name == 'prod' else None }}"
Not 100% sure this would work but something along these lines, might need to point a gitignored file. The source synchronization is meant to both add new tables from a source but also remove stuff that no longer exists. I don't see why we couldn'e have a flag to opt out of any behavior like that though.
Intro
In our project we have to support different set of sources for dev and prod envs. We found a bug with
dbt-osmosis yaml refactor
: disabled sources are corrupted if source file location is set indbt_project.yml
like this:Here is a file containing minimal DBT project reproducing behavior described above: dbt-osmosis-disabled-source-bug.zip
How to reproduce
.\.venv\Scripts\activate
orsource .venv/bin/activate
pip install -r requirements.txt
dbt build
dbt build --target prod
_prod_sources.yml
content, it should bedbt-osmosis yaml refactor
_prod_sources.yml
content, it now contains no tables and config is wrong:_dev_sources.yml
content, it's updated correctly: