Hi, I am trying to add a Meltano job to run a `dbt...
# troubleshooting
v
Hi, I am trying to add a Meltano job to run a
dbt-postgres
command that excludes a specific model. I am using the following
meltano job add
command:
meltano job add example-job --tasks "[tap-postgres target-postgres, dbt-postgres:run --exclude excluded_model]"
However, when I run this command, I get an error message saying "`Job 'example-job' has invalid tasks. Block --exclude not found`". Logs:
Copy code
2023-05-10T10:01:46.704820Z [info     ] Environment 'dev' is active
Need help fixing this problem? Visit <http://melta.no/> for troubleshooting steps, or to
join our friendly Slack community.

Job 'example-job' has invalid tasks. Block --exclude not found
It seems that the
--exclude
option is not recognized by the
dbt-postgres
adapter. Is there a way to exclude a specific model from a
dbt-postgres
task in Meltano? If not, what is the recommended way to handle model exclusion in this case? Thank you for any help or suggestions.
m
It looks like meltano’s interpreting
--exclude
and
excluded_model
as separate commands. I think https://docs.meltano.com/concepts/project#plugin-commands is the way to accomplish what you’re trying to do. If you update your meltano.yml entry for dbt-postgres to be the following:
Copy code
- name: dbt-postgres
  variant: dbt-labs
  commands:
    my_models:
      args: run --exclude excluded_model
Then you should be able to use
meltano job add example-job --tasks "[tap-postgres target-postgres dbt-postgres:my_models]"
to add the job definition.
v
Thank you, 👍