I'm trying create a Meltano task with dbt like so:...
# troubleshooting
h
I'm trying create a Meltano task with dbt like so:
Copy code
- dbt-redshift:run -s customerio
When I run this with the
-s
selector I get the following error:
Copy code
Error: Block -s not found
Something to do with the way Meltano is parsing the YML I think. Adding quotes doesn't help. How can I select the models to run. Doing
dbt-redshift:run
alone works.
s
Ran into the same thing recently. You would need to use invoke, as jobs by default use
meltano run
. Invoke allows you to pass in plugin specific arguments. Here is an example of a workaround that I have implemented.
Copy code
utilities
- name: dbt-wrapper
    namespace: dbt-wrappers
    commands:
      run:
        args: invoke dbt-postgres:run --select models/data
        executable: meltano
And then in your task:
Copy code
- dbt-wrapper:run
💯 1
h
OK it works with the wrapper approach, but feels kinda clunky. Can I not define the command under the existing transformer entry like so:
Copy code
commands:
      run_customerio:
        args: invoke dbt-redshift:run -s customerio
        executable: meltano
This currently gives me an error saying:
Copy code
Cannot start plugin: Executable 'dbt' could not be found. Transformer 'dbt-redshift' may not have been installed yet using `meltano install transformer dbt-redshift`,
e
This works for me for running `dbt build --empty`:
Copy code
utilities:
  - name: dbt-duckdb
    variant: jwills
    pip_url: dbt-core~=1.10.0b1 dbt-duckdb~=1.9.1 duckdb==1.2.2 meltano-dbt-ext~=0.3.0
    config:
      path: $DUCKDB_PATH
    commands:
      dry-run:
        args: build --empty
        executable: dbt
as
meltano run dbt-duckdb:dry-run
We might just need better examples in the Meltano docs and/or in the Hub.