z3z1ma/dbt-osmosis

When running dbt-osmosis yaml refactor to add a new table to schema.yml file : KeyError: 'sources'

Closed this issue · 1 comments

Hello,
I don't know if the issue comes from a wrong architecture on my side or not but here is the issue :

  • When I run dbt-osmosis yaml refactor path/to/models to add newly created models to my schema.yml, I get a KeyError 'sources' that I usually solve by modifying locally the /core/osmosis.py file on row 681 :
  • if structure.output["sources"] -> if structure.output.get("sources")
    To be safe, I also do the same change on row 679.

To be precise, I have a different .yml file for my sources and my models.

This is fixed with a lock on mutation during restructuring