Hello, is there a way to load assets produced by a...
# ask-community
q
Hello, is there a way to load assets produced by a run using the Python API if I have a
run_id
, and the
AssetKey
for the asset I want to materialize? This is how I’m currently materialising assets:
Copy code
# Materialize some asset
result = dagster.materialize(assets=[...])

# get the run id
result.run_id
t
Hi, what do mean by "load the asset"? Do you mean accessing it via it's IO Manager? and in what context?
q
Hi @Tim Castillo, I mean something like loading it to memory. An example of my use case:
Copy code
import datetime

@dagster.asset
def asset_a():
    return datetime.datetime.now()

def asset_b(asset_a):
    return asset_a + datetime.timedelta(days=1)
In this example, every time I materialise
asset_a
, I get a different result. Let’s say I’ve materialised it 3 times, and got 3 versions which is saved in
materialised-assets
. Now I want to be able to pick a version of
asset_a
to materialise
asset_b
. I’m asking if there’s a way to load assets produced by a run because I think by being able to load
asset_a
into memory, I can then feed it to
asset_b
for materialization (Is this even a good way to go about it?). Thank you.