Harry Park
06/28/2023, 11:29 AMsean
06/28/2023, 2:25 PM1) How do I get externally created assets (files) into Dagster’s asset system? Scheduled job for a Sensor op to emit AssetObservations of SourceAssets?Yes, model them as
SourceAssets
. One approach is to use observable source assets to generate AssetObservations
.
2) Do I then write an IO manager to load and write these assets? Or is this optional.If they are specified as dependencies in the usual way, then your IO manager will need to be able load them (not write them if they are source assets). Or you can use
non_argument_deps
and write whatever logic you want to load them inside of an upstream asset compute function (i.e. skip the IO manager)
3) If I want to run backfills on the SourceAsset, do I make an Op that calls the execute_shell_script C# program with the keys to make the asset and then have it emit an AssetObservation?“Backfills of a SourceAsset” is an undefined notion in Dagster, because a
SourceAsset
is by definition an asset for which Dagster does not control materializations.Harry Park
06/28/2023, 4:33 PMBen Ogorek
07/01/2023, 2:19 AMsean
07/01/2023, 6:04 PMfrom dagster import graph_asset
from dagster_shell import create_shell_command_op
hey_op = create_shell_command_op("echo hey", name="hey_op")
@graph_asset
def hey():
return hey_op()
Ben Ogorek
07/01/2023, 9:26 PMHarry Park
07/01/2023, 9:27 PMBen Ogorek
07/01/2023, 9:30 PM