https://prefect.io logo
Title
s

Stephen Lloyd

04/12/2023, 10:06 AM
More difficulties with
dbtCoreOperation
. I am running...
with DbtCoreOperation(
        commands=["dbt deps", "dbt build " + dbt_build_arg + " --target " + DBT_ENV],
        project_dir="edw-dbt",
        # working_directory="edw-dbt",
        # overwrite_profiles=True,
        profiles_dir="~/.dbt",
        # dbt_cli_profile=dbt_cli_profile,
        stream_output=True,
    ) as dbt_operation:
        dbt_process = dbt_operation.trigger()
        dbt_process.wait_for_completion()
        result = dbt_process.fetch_result()
Currently failing with:
15:35:09.705 | INFO    | Flow run 'furry-carp' - PID 98611 stream output:
09:50:09  Error importing adapter: No module named 'dbt.adapters.snowflake'
15:35:09.706 | INFO    | Flow run 'furry-carp' - PID 98611 stream output:
09:50:09  Encountered an error while reading profiles:
  ERROR: Runtime Error
  Credentials in profile "edw", target "dev" invalid: Runtime Error
    Could not find adapter type snowflake!Defined profiles:
 - edw
For more information on configuring profiles, please consult the dbt docs:

<https://docs.getdbt.com/docs/configure-your-profile>
15:35:09.720 | INFO    | Flow run 'furry-carp' - PID 98611 stream output:
09:50:09  Encountered an error:
Runtime Error
  Could not run dbt
prefect-dbt==0.3.1 prefect-snowflake is present
s

Sean Williams

04/12/2023, 3:05 PM
What do you see if you run
dbt debug
? It also looks like someone had a similar issue, here: https://discourse.prefect.io/t/prefect-dbt-on-macos/2499/2
:upvote: 1
s

Stephen Lloyd

04/20/2023, 4:57 AM
Sorry for the late reply.
dbt debug
threw the same error. I did figure this out though. DbtCoreOperation does not need you to run
dbt_cli_profile.get_profile()
since it runs it internally. There was an issue with the docs that we reported. Presumably it is fixed now.