I am new to prefect but i was going to try and use...
# prefect-community
m
I am new to prefect but i was going to try and use it to test run my DBT commands. I have DBT setup in a folder locally with a profiles.yml and a project dir however, I cant seem to get the flow to find it.
Copy code
from prefect import flow

from prefect_dbt.cli.credentials import DbtCliProfile
from prefect_dbt.cli.commands import trigger_dbt_cli_command

@flow
def trigger_dbt_cli_commands_flow():
    dbt_cli_profile = DbtCliProfile.load("dbtbase")

    trigger_kwargs = dict(
        profiles_dir="../dbt/data-dbt",
        project_dir="../dbt/data-dbt/dbt-project/",
        overwrite_profiles=False,
        dbt_cli_profile=dbt_cli_profile,
    )

    trigger_dbt_cli_command(
        "dbt deps",
        **trigger_kwargs
    )
    return result

trigger_dbt_cli_commands_flow()
1
which give me the following error - Unable to find block document named dbtbase for block type dbt-cli-profile
j
are you sure your profiles file is available as a block?
m
it would appear not, i was a bit confused by that. However I also am not sure how to make it a block. I tried converting my local profiles.yml to a json file and using that in the ui but that im guessing is not correct either
Are there any examples? Ideally I would like to just use my local profile file
j
I didn’t use any blocks, you can pass the profile dir as an arg:
Copy code
profiles_dir=config.DBT_PROFILES_DIR_PATH,
Oh you have it on your example and all
m
ah maybe it got confused and i dont need the dbt_cli_profile = DbtCliProfile.load("dbtbase") bit
j
probably
m
yup that was it, now just to work out how to clone a private github repo
j
about that repo: you can create an ssh key and move it to your deployment, then run a shell task to clone it
🙌 1
j
Reading from a private GitHub repo is about to be more convenient. You can track the PR here.
🙌 1