-
I have a run ID. How do I get the asset materialization events from it? |
Beta Was this translation helpful? Give feedback.
Answered by
sryza
Jun 5, 2023
Replies: 1 comment
-
You'll need a Then, you can use from typing import Sequence, cast
from dagster import AssetMaterialization, DagsterEventType, DagsterInstance
def get_assets_materializations_for_run(instance: DagsterInstance, run_id: str) -> Sequence[AssetMaterialization]:
materialization_records = instance.get_records_for_run(
run_id=run_id, of_type=DagsterEventType.ASSET_MATERIALIZATION
).records
return [record.asset_materialization for record in materialization_records] |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
sryza
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You'll need a
DagsterInstance
object to access the Dagster database. You can get aDagsterInstance
from anycontext
variable, or viaDagsterInstance.get
.Then, you can use
get_records_for_run
.