Is there a quick way to determine via context if a...
# ask-community
Is there a quick way to determine via context if an asset has ever been materialized?
Hey @Charlie Bini - I created a discussion to answer this, because I suspect others might be curious too:
very nice!
@sandy uncovered a potential bug related to this. I have an asset using
to change some parameters if this is the first time the asset has been materialized. The function works as expected, but the initial run failed, and then upon retry, it actually returned a materialization record, even though the asset had not been successfully materialized.
I can send you the debug logs for the run in DMs if you want
Charlie isn't an asset that had a run failure a different state than one that has never materialized? The behavior you describe is what I would expect. It did materialize, just not successfully. There could be many reasons for this, but I would expect to look at the status of the materialization for more info, not to have it show up as never materialized.
Hi all, I am wondering if there has been any success using the provided GitHub code? I have asset A being updated daily. Then, end of week I want to save a snapshot of asset A as asset B for use with an op that compares the changes of asset B weekly. It looks like my issue is only on the instantiation of the pipeline similar to the above: the provided code fails, then returns a materialization record upon retry but fails because asset B does not yet exist. So my full question is, is it possible to do something along the lines of the below?
Copy code
if context.instance.get_latest_materialization_event(asset_A_key) is None:
           return empty_dataframe
           return asset_b_dataframe