When model sql file exists in models folder without model name does not register in schema.yml, dbt-osmosis yaml refactor is failed.
The error messages I have encountered are as follows:
Traceback (most recent call last):
File "/Users/s23467/Library/Caches/pypoetry/virtualenvs/aoc-akagi-cdp-dbt-Pv9R6Ian-py3.11/bin/dbt-osmosis", line 8, in <module>
sys.exit(cli())
^^^^^
File "/Users/s23467/Library/Caches/pypoetry/virtualenvs/aoc-akagi-cdp-dbt-Pv9R6Ian-py3.11/lib/python3.11/site-packages/click/core.py", line 1157, in __call__
return self.main(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/s23467/Library/Caches/pypoetry/virtualenvs/aoc-akagi-cdp-dbt-Pv9R6Ian-py3.11/lib/python3.11/site-packages/click/core.py", line 1078, in main
rv = self.invoke(ctx)
^^^^^^^^^^^^^^^^
File "/Users/s23467/Library/Caches/pypoetry/virtualenvs/aoc-akagi-cdp-dbt-Pv9R6Ian-py3.11/lib/python3.11/site-packages/click/core.py", line 1688, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/s23467/Library/Caches/pypoetry/virtualenvs/aoc-akagi-cdp-dbt-Pv9R6Ian-py3.11/lib/python3.11/site-packages/click/core.py", line 1688, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/s23467/Library/Caches/pypoetry/virtualenvs/aoc-akagi-cdp-dbt-Pv9R6Ian-py3.11/lib/python3.11/site-packages/click/core.py", line 1434, in invoke
return ctx.invoke(self.callback, **ctx.params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/s23467/Library/Caches/pypoetry/virtualenvs/aoc-akagi-cdp-dbt-Pv9R6Ian-py3.11/lib/python3.11/site-packages/click/core.py", line 783, in invoke
return __callback(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/s23467/Library/Caches/pypoetry/virtualenvs/aoc-akagi-cdp-dbt-Pv9R6Ian-py3.11/lib/python3.11/site-packages/dbt_osmosis/main.py", line 80, in wrapper
return func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "/Users/s23467/Library/Caches/pypoetry/virtualenvs/aoc-akagi-cdp-dbt-Pv9R6Ian-py3.11/lib/python3.11/site-packages/dbt_osmosis/main.py", line 216, in refactor
if runner.commit_project_restructure_to_disk():
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/s23467/Library/Caches/pypoetry/virtualenvs/aoc-akagi-cdp-dbt-Pv9R6Ian-py3.11/lib/python3.11/site-packages/dbt_osmosis/core/osmosis.py", line 692, in commit_project_restructure_to_disk
if structure.output["sources"]:
~~~~~~~~~~~~~~~~^^^^^^^^^^^
KeyError: 'sources'
Hi!
I found the edge case bug.
When model sql file exists in models folder without model name does not register in schema.yml,
dbt-osmosis yaml refactor
is failed.The error messages I have encountered are as follows: