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

VS Code - Osmosis Execute DBT SQL feature failing #13

Closed MurugR closed 1 year ago

MurugR commented 2 years ago

Hello and thanks for looking at my issue. When I click on this button after opening a model sql file in VS Code, image

I get this error. image

The actual path is c:\\Temp\git\au-nvg-business-intelligence\\dbt\navigate_bi\\dbt_project.yml. Because there are single backslashes in 2 spots (\au-nvg-xxx and \navigate_bi\xxxx), both are being translated to \a and \n. I don't know why a mixture of single and double backslashes are coming in the file name and path.

I've had to put a temp fix in osmosis.py in line 181 to get this working. See project_dir being added with replace calls.

args = PseudoArgs(
            threads=threads,
            target=target,
            profiles_dir=profiles_dir,
            #project_dir=project_dir,
            project_dir=project_dir.replace('\t', '\\t').replace('\n', '\\n').replace('\r', '\\r').replace('\a', '\\a'),
        )
MurugR commented 2 years ago

Hi,

Please refer to https://github.com/innoverio/vscode-dbt-power-user/issues/130. By following @mdesmet's advise and moving the flexibility down to targets, I got to keep the profile name static. This has also fixed the issue reported above.

image

z3z1ma commented 1 year ago

Closing this issue as resolved!