z3z1ma / dbt-osmosis

Provides automated YAML management, a dbt server, streamlit workbench, and git-integrated dbt model output diff tools
https://z3z1ma.github.io/dbt-osmosis/
Apache License 2.0
456 stars 46 forks source link

Error starting workbench #11

Closed ghost closed 2 years ago

ghost commented 2 years ago

Encountering below page output (and on CLI as well) when executing dbt-osmosis workbench -m unique_model_name. Seems it's getting a none value for a file path, but I'm not sure where or how exactly. This is my first run of dbt-osmosis workbench.

AttributeError: 'NoneType' object has no attribute 'patch_path'
Traceback:
File "C:\Users\myusername\AppData\Local\Programs\Python\Python310\lib\site-packages\streamlit\scriptrunner\script_runner.py", line 554, in _run_script
    exec(code, module.__dict__)
File "C:\Users\myusername\AppData\Local\Programs\Python\Python310\lib\site-packages\dbt_osmosis\app.py", line 345, in <module>
    Path(ctx.project_root) / ctx.get_patch_path(st.session_state[BASE_NODE]),
File "C:\Users\myusername\AppData\Local\Programs\Python\Python310\lib\site-packages\dbt_osmosis\core\osmosis.py", line 179, in get_patch_path
    return Path(node.patch_path.split(FILE_ADAPTER_POSTFIX)[-1])
z3z1ma commented 2 years ago

I noticed that too. The patch_path is not populated if you don't have a yaml file with the model in it.

I will release a hot fix for this in a few hours. In the meantime you can do a dbt-osmosis run command to automatically generate the file if you have added the dbt-osmosis: config key to your dbt_project.yml as documented in the readme. Thanks for the issue raise 🙏

z3z1ma commented 2 years ago

Issue fixed in last push/release. Available on github + pypi