Hi all, I'm currently trying to upgrade my meltano...
# troubleshooting
b
Hi all, I'm currently trying to upgrade my meltano-managed dbt project from v1.6 => v1.7, and have run into an apparent breaking change: dbt no longer allows cleaning paths outside the project directory by default, and meltano's default target path (
.meltano/transformers/dbt/target/
) is outside the dbt project directory (
transformer/
). As a result, any run gives an error:
Copy code
2023-11-06T18:57:57.133172Z [info     ] Environment 'dev' is active
Extension executing `dbt clean`...
18:57:58  Running with dbt=1.7.0
18:57:58  Encountered an error:
Runtime Error
  dbt will not clean the following directories outside the project: ['.meltano/transformers/dbt/target']
This is similar to but (afaict) not the same as this open issue from last year. Just wondering if anyone else has had this issue and/or if meltano folks have specific recommendations about how to handle this change in dbt's functionality. Poking around dbt's code suggests that there may be a straightforward workaround -- adding a new envvar / cli flag -- but maybe there's a better or less clunky way to address this. Thanks in advance for your help!
e
I was wondering why I hadn't run into this in my dogfood project and it's simply because I updated
dbt_project.yml
to point to the dbt project root:
Copy code
target-path: "target"
clean-targets:
    - "target"
    - "dbt_packages"
Perhaps it's worth updating the default in the meltano extension: https://github.com/meltano/dbt-ext/blob/e445807dee6326ae8509a9c8239a489000797a0b/files_dbt_ext/bundle/transform/dbt_project.yml#L18-L24
b
hi @edgar_ramirez_mondragon, thanks for this! only catch i see is that including
target-path
in
dbt_project.yml
is deprecated: https://docs.getdbt.com/reference/project-configs/target-path#configuration is there another, more future-proof approach?
fwiw i got things to work by specifying
DBT_CLEAN_PROJECT_FILES_ONLY: false
in my env (via docker compose file), which lives here
e
Thanks for sharing your solution!