Hello! I am trying to get Prefect DBT integration...
# ask-community
c
Hello! I am trying to get Prefect DBT integration working. I am using
prefect-dbt
library, following examples at https://prefecthq.github.io/prefect-dbt/cloud/jobs/:
Copy code
...
    dbt_cloud_credentials = DbtCloudCredentials.load("dbt-token")
    dbt_cloud_job = DbtCloudJob.load(
        dbt_cloud_credentials=dbt_cloud_credentials,
        job_id=154217
    )
    ...
However, when I try to run the above, I get error
Copy code
TypeError: Block.load() got an unexpected keyword argument 'dbt_cloud_credentials'
Looking at source, the signature for
DbtCloudJob.load()
is that for class
Block
in
prefect.blocks.core
. This signature has no support for
dbt_cloud_credentials
or
job_id
Can someone please assist?
k
You can remove the
.load
part, looks like that's a small mistake in the example. Sorry!
.load
is for loading existing saved blocks by name.
Just call the constructor,
DbtCloudJob()
, with your arguments.
c
@Kevin Grismore testing now. thanks for the super-fast response!
@Kevin Grismore yup - that was the trick. should've spotted that. thanks!
🙌 1
@Kevin Grismore also - how can i load existing job blocks by name, if (as far as i can see) there is no support for a DBT job block in Prefect cloud
k
If for whatever reason you're not seeing block types from a specific package, you can register them manually and they'll appear in the UI: https://docs.prefect.io/latest/concepts/blocks/#registering-blocks-for-use-in-the-prefect-ui
c
@Kevin Grismore awesome! thanks again!