This message was deleted.
# ask-community
s
This message was deleted.
s
that error looks like the op/asset is yielding an output named
sixth_dbt
, but the only output available is
third_dbt
.
l
but what does this mean? these dependencies have always worked and are really, really simple
s
do you do any explicit naming of assets?
l
Yes, for example:
Copy code
dbt_assets_1 = load_assets_from_dbt_project(project_dir=DBT_PROJECT_DIR, select="first_dbt")
dbt_assets_2 = load_assets_from_dbt_project(project_dir=DBT_PROJECT_DIR, select="second_dbt")
dbt_assets_3 = load_assets_from_dbt_project(project_dir=DBT_PROJECT_DIR, select="third_dbt")
s
ah, i see. where is
sixth_dbt
coming from?
and why would it be getting confused with
third_dbt
? maybe there are assets named identically?
l
sixth_dbt, comes from second_dbt here is the code:
Copy code
/*{{ config(materialized='view') }}*/

{{ config(
    tags='advertisement'
) }}

select *
from {{ ref("second_dbt") }}
and third comes as well from second, they are two branches of the dag
šŸ’” 1
s
gotcha, so these are models in the dbt project. so your
dbt_run_project
job is materializing all the indvidual assets in the dbt project. and that specific op is yielding an asset key that doesn't exist (or something). My first thought is that maybe
sixth_dbt
is not able to run correctly in the dbt project? Does the model run okay?
l
If I run
dbt run
, everything works perfectly in a few seconds. :(
To me it looks like that, when i create two branches from a node, one of them goes right, and the other one always returns this error
s
yeah, i think what might be happening is that when you load the assets multiple times, duplicate entries get created for assets that are named the same thing. if you just did
Copy code
dbt_assets = load_assets_from_dbt_project(project_dir=DBT_PROJECT_DIR)
once, without a
select
, i wonder if that would work.
ā¤ļø 1
( i haven't done any work with the dbt assets stuff myself)
l
It's frustrating because this same project was running smoothly until few weeks ago, I just cloned my own code without changing anything
šŸ¤· 1
s
great time to deprecate a dbt model šŸ˜‰
l
I am going to try this solution, maybe you just lit up the light bulb in my brain ahahaha
šŸŒˆ 1
Ok so update: the presentation went great and this (dbt_assets = load_assets_from_dbt_project(project_dir=DBT_PROJECT_DIR)) worked fine so: thank you @Stephen Bailey yay The only problem left is that, by importing all assets at once, I can't restart a "broken" dag from the point of failure. When I choose "restart from failure", dagster restarts the whole tree from the first node. It would be great to import all the assets easily AND also repeat only the failed nodes when needed šŸ‘€
šŸŒˆ 1
s
woo! i think the "restart from failure" problem is endemic to the limitations of dbt / the integration. dagster would need to be smart enough to run
dbt run --select failed_model+
dynamically to accommodate it. One thing you might be able to do instead is to go to Global Asset Graph > select
failed_models+
in the selector, then run a new job
yay 1
l
Later I am going to try this! You are so kind, thank you! šŸ¤©šŸ™šŸ»
blob highfive 1
y
cc @owen regarding restart from failure w/ dbt assets
ā¤ļø 1
o
ah that's a good point about restart from failure -- right now the button in the UI purely restarts from the failed ops, but because all of the dbt models run in the same operation (dbt run), this results in the behavior you're experiencing. One thing we're considering adding to the job / global asset graph pages is a "rematerialize failed assets" button (naming tbd), which would streamline the process that @Stephen Baileyā€™s describing (because you wouldn't need to manually come up with that asset selection). As it stands now though, that's what I'd recommend doing šŸ™‚
ā¤ļø 1
l
Thank you @owen, @yuhan and again @Stephen Bailey. I am looking forward to this function. It would be absolutely perfect for my company!
Hi @owen yay, do you have any news about the "restart from failure" function? I came back on the dagster project for my company and we are still looking for this exact function. It would be the cherry on the cake for what I am trying to do. šŸŒˆ
o
hi @Lorenzo! It's not quite a "restart from failure" button, but there is now a "rematerialize stale assets" button in the UI, which should work for this use case -- essentially, assets whose parents have been materialized more recently than they have been are marked as stale, and you can run just those stale assets from the UI. If a dbt run fails halfway though, then the assets that did not get materialized will all be "stale" (as their parents were rematerialized, but they weren't), so this should, in most cases, be the selection you want.
ā¤ļø 1