ptus
07/18/2022, 10:59 AMDagsterInstance
and AssetKey
.
What I'm trying to achieve is to have an interactive way to experiment with some defined assets. For example, let's say I have an "iris dataset" asset. I'd now like to have a Jupyer notebook where I could interactively experiment with the "iris asset", without having to re-implement the code that produces it.
I have been thinking that connecting to the Dagster instance and somehow loading the asset would be the right way to do this:
from dagster import DagsterInstance
instance = DagsterInstance.get()
asset_keys = instance.get_asset_keys()
# would like to "load a specific asset now"
I have also looked into Dagstermill
, but I didn't find a way to "interactively" load asset data into the notebook. Unless I missed something, it seems that Dagstermill is suited for end-to-end running of notebooks, while I just need a way to load an asset into the notebook, and then interactively experiment wiht it.
Thanks all!ptus
07/18/2022, 11:12 AMZach
07/18/2022, 1:52 PMload_input
method to get your asset if you have the asset key (you'd have to build an input context using build_input_context
).
Alternatively you could add the location of the asset as metadata to your AssetMaterialization or as an AssetObservation, then retrieve the materialization through the graphql assetsOrError endpoint and parse the metadata from that. In fact, I think the default fs_io_manager
already adds the location as metadata under the path
label.sandy
07/19/2022, 10:46 PM