how do I add dbt-postgres-python to meltano? <http...
# troubleshooting
r
how do I add dbt-postgres-python to meltano? https://pypi.org/project/dbt-postgres-python/
b
I would check to see if it is in the Meltano Hub. https://hub.meltano.com/
r
it’s not. Is there any tutorial explaining how to create meltano utilities from dbt adapters?
b
Is this what you were looking for ? https://hub.meltano.com/utilities/dbt-postgres
r
no, dbt-postgres-python is a custom dbt transformer that allows you to create dbt transformations using python code
e
r
does not seem to work when I try to add custom as transformer
b
dbt-ext is what allows dbt-postgres and dbt-snowflake to work with meltano. You might be able to use dbt-ext as is to work with dbt-postgres-python. If not the dbt-ext was written using the EDK. Here are two links I found hopefully they help. https://github.com/meltano/dbt-ext https://edk.meltano.com/en/latest/
e
does not seem to work when I try to add custom as transformer
Can you say more about what failed? @BuzzCutNorman 's right. Another approach is to add tap-postgres and tweak the
pip_url
for starters
r
this is the error:
Copy code
Extension executing `dbt run`...
17:37:47  [WARNING]: Deprecated functionality

User config should be moved from the 'config' key in profiles.yml to the 'flags' key in dbt_project.yml.
17:37:47  Running with dbt=1.7.16
17:37:47  Error importing adapter: No module named 'dbt.adapters.fal'
17:37:47  Encountered an error:
Runtime Error
  Credentials in profile "meltano", target "dev_with_fal" invalid: Runtime Error
    Could not find adapter type fal!
e
What does
meltano.yml
look like?
r
https://gist.github.com/ciocan/c07f38e950903af61be86d8282bf4adb and there is files just with spreadsheets-anywhere config
e
can you try adding
dbt-postgres-python
to the
pip_url
, doing
meltano install
and trying again?
r
I tried like:
Copy code
utilities:
  - name: dbt-postgres
    variant: dbt-labs
    pip_url: dbt-core==1.7.16 dbt-postgres==1.7.16 git+<https://github.com/meltano/dbt-ext.git@main>
    config:
      schema: forward_analytics
  - name: dbt-postgres-python
    variant: dbt-labs
    pip_url: dbt-core==1.7.16 dbt-postgres==1.7.16 git+<https://github.com/kudryk/dbt-postgres-python.git@main>
    config:
      schema: forward_analytics
and get error: Utility ‘dbt-postgres-python’ is not known to Meltano. Try running
meltano lock --update --all
to ensure your plugins are up to date. and Utility ‘dbt-postgres-python’ is not known to Meltano. Check https://hub.meltano.com/ for available plugins.
b
Maybe give this a try. I would deleted out the
dbt-postgre
config and keep
dbt-postgres-python
and then give the following
pip_url
lines a try in the
dbt-postgres-python
config.
Copy code
pip_url: dbt-core==1.7.16 git+<https://github.com/kudryk/dbt-postgres-python.git@main> git+<https://github.com/meltano/dbt-ext.git@main>
Copy code
pip_url: dbt-core==1.7.16 dbt-postgres==1.7.16 git+<https://github.com/meltano/dbt-ext.git@main> git+<https://github.com/kudryk/dbt-postgres-python.git@main>
If these don't work my next suggestion would be trying adding in a
settings:
and
command:
sections like shown in the dbt-ext repo. Using the
dbt-postgres
example as a template to work from.
👍 1
r
did not work either of them. I tried to plumb everything together here: https://github.com/ciocan/meltano-dbt-postgres-python-model Maybe it’s an obvious mistake that I manage to overlook …