https://dagster.io/ logo
Title
t

Tobias Krause

03/03/2023, 11:52 AM
Hi, does anyone know if its possible to use non_argument_deps with @graph_asset too? Or at least to achieve the same behavior?
t

Tobias Pankrath

03/03/2023, 12:03 PM
Looks to be impossible right now. The
@graph_asset
lacks the argument and the implementation is:
def __call__(self, fn: Callable) -> AssetsDefinition:
        asset_name = self.name or fn.__name__
        asset_ins = build_asset_ins(fn, self.ins or {}, set())
        out_asset_key = AssetKey(list(filter(None, [*(self.key_prefix or []), asset_name])))
where _Asset passes `non_argument_deps`to
build_asset_ins
,
_GraphBackedAsset
does not.
t

Tobias Krause

03/03/2023, 4:18 PM
Would it be sufficient to pass it along to
build_asset_ins
in
_GraphBackendAsset
?
s

sandy

03/03/2023, 4:25 PM
t

Tobias Krause

03/03/2023, 5:01 PM
We are using the inner op within different graphs and different input deps. The workaround would clutter the parameter list as we would need to consume all input deps somehow. I've played around with
@graph
and
AssetsDefintion.from_graph
to set
keys_by_input_name
manually. So far, without success.
s

sandy

03/03/2023, 5:30 PM
ultimately, dagster represents the dependencies within a run as a graph of ops - so to have op A execute after op B, the dependency between them needs to be piped through any graphs that contain those ops