`meltano invoke dbt-postgres:clean` doesn't seem ...
# troubleshooting
m
meltano invoke dbt-postgres:clean
doesn't seem to work. It says cleaned but it doesn't do anything. Can we configure a pre-hook command like
rm -rf ./transform/target
before
dbt-postgres:run
p
@mert_bakir I think this might be a dbt thing https://github.com/dbt-labs/dbt-core/issues/4762 since we have the default target path outside the dbt project directory it fails to clean. The commenter suggested that we add an
--unsafe
flag or
--force
to allow dbt to delete outside its directory. You can create an issue in the dbt extension repo to potentially override the behavior of
clean
for our purposes, idk if we want to do that but it can be discussed.
Oh another flexible option you can use is to just have a meltano dbt command that runs a bash command like:
Copy code
commands:
      clean_override:
        executable: /bin/bash
        args: -c ls
I think if you put your
rm -rf ./transform/target
bash command in place of the
ls
then it would do what you want. I believe the
-c
is a required prefix to get it to work though
m
Copy code
clean_override:
        executable: /bin/bash
        args: -c "rm -rf target"
Works this way, Thanks!