Todd de Quincey
08/07/2023, 1:50 PMTodd de Quincey
08/07/2023, 1:51 PMtags
.
The attached screenshot is an example of one of the asset groups / jobs that will run. However, when we run the job (either via scheduled run or a manual run), I see that Dagster is running all of the assets in a single run - which is not what I expected.
I was expecting that each asset would be materialized in it’s own run, therefore allowing us to re-run only individual steps in the event of failures etc etc.
I presume this is a user error.
Any guidance would be much appreciated
Running on Dagster 1.4.4
assets = with_resources(
load_assets_from_dbt_project(
profiles_dir=DBT_PROJECT_PATH,
project_dir=DBT_PROFILES,
# Use the first dbt tag as the asset group
node_info_to_group_fn=lambda node: node["config"]["tags"][0]
if node["config"]["tags"] != []
else None,
display_raw_sql=True,
exclude="tag: integration_tests unit-tests",
),
{
"dbt": dbt_cli_resource.configured(
{
"project_dir": DBT_PROJECT_PATH,
"profiles_dir": DBT_PROFILES,
},
)
},
)
We then create the job as so:
define_asset_job(name="dbt_tag_here", selection=AssetSelection.groups("dbt_tag_here"))
rex
08/07/2023, 1:56 PMdbt run --select asset1
, dbt run --select asset2
, … Like you pointed out, we will run dbt run --select asset1 asset2
).Todd de Quincey
08/07/2023, 1:58 PMTodd de Quincey
08/07/2023, 1:58 PMTodd de Quincey
08/07/2023, 2:00 PMrex
08/07/2023, 2:03 PMTodd de Quincey
08/07/2023, 2:05 PMThis is actually more efficient since it saves on process initialization cost, step startup cost, etc.That makes sense from that POV.
You should be able to just rematerialize failed models from the UI — you don’t need to manually select them.Ah ok. I naively presumed that doing this would re-run the same command (ie. selecting all 20 assets). Not just the 3 failed ones. Great to know. Thanks for taking the time to clarify this for me.
rex
08/07/2023, 2:09 PMMaterialize all
in your job view to see the screenshot that I posted.
In the runs view (your screenshot) I believe you are correct: we re-run the same command from failure. I think your suggestion makes sense here. We could probably add the same button to Re-execute failed assets from the runs page, similar to the jobs page. Will double check with the teamTodd de Quincey
08/07/2023, 2:10 PMQwame
08/07/2023, 5:15 PMrex
08/07/2023, 5:31 PMrex
08/07/2023, 6:01 PMTodd de Quincey
08/07/2023, 6:02 PM