Hi Folks, is there anyway to trigger an asset mate...
# ask-community
j
Hi Folks, is there anyway to trigger an asset materialization from inside an op? something lis:
Copy code
@op
def trigger_asset_materialization():
    materialize_asset(asset_key=[.....])
o
hi @Jeferson Machado Santos ! answered this question here: https://dagster.slack.com/archives/C01U954MEER/p1684872544643039
j
Yes, but is it possible with asset key?
because i am importing assets from dbt manifest, so I am not defining them with @asset
o
ah in that case you could do
Copy code
dbt_assets = load_assets_from_dbt_manifest(...)

@op
def my_op(context):
   materialize(assets=[dbt_assets], instance=context.instance, selection=AssetSelection.keys("my_key", "my_other_key"))
however, the same general advice of "this should probably be in a `define_asset_job`" applies
j
yeah, but i need to materialize only some of the assets in dbt_assets
not all of them
ah, I see, I can use selection, right?
👍 1
thanks
o
blob salute
j
It worked perfect owen, thank you very much
and yes, I used define_asset_job.