Guys, I’m trying to run a dbt pipeline in Dagster,...
# integration-dbt
r
Guys, I’m trying to run a dbt pipeline in Dagster, where first I tried to define the assets by the load_assets_from_dbt_project function, but when I called the execution of the dbt asset, the Dagster didn’t recognize the dbt manifest. Then I tried to generate the asset by the load_assets_from_dbt_manifest function and now I’m getting this error in the attached image: This is my code:
Copy code
import json
from dagster import (
    asset,
    Definitions, 
    load_assets_from_package_module
)

from dagster_dbt import load_assets_from_dbt_manifest
from dagster_airbyte_example.assets import airbyte
from .config.constants import DOMAIN, BI_OWNER

airbyte_assets = load_assets_from_package_module(
    airbyte,
    key_prefix="best_target"
)

manifest_file = "/home/raphael-pacheco/workspace/dagster-airbyte-example/best_target/target/manifest.json"

with open(manifest_file, encoding='utf-8') as f:
    manifest = json.load(f)

dbt_assets = load_assets_from_dbt_manifest(
    manifest,
    key_prefix="best_target",
)

defs = Definitions(
    assets=[*airbyte_assets] + dbt_assets,
)
What am I doing wrong? Thanks in advance
t
Hi! You'll need to add a dbt Resource to your project. You can learn how to do that through this step in our dagster+dbt guide https://docs.dagster.io/integrations/dbt/using-dbt-with-dagster/part-two#step-2-define-a-dagster-code-location
r
Thanks so much for the feedback, Tim Castillo! It was really missing to define the resource 😅 It was just defining the resource that worked. Thanks!
🌈 1
daggy success 1