Clement Emmanuel
02/13/2023, 11:34 PMcontext.asset_partition_key_for_output()
) are the `op`s that are marked as producing a result output for the overarching graph. Ideally i'd like to just access this info from any op within the graph underlying the asset, not necessarily just the op
that is supposedly producing the asset.
Dummy example (please excuse, writing a simplified version of my problem by hand here, might not exactly compile but essentially looks like this):
from dagster import graph, op, job, AssetsDefinition, DailyPartitionsDefinition
@op
def root_op(context):
# raises `dagster._check.CheckError: Failure condition: The output has no asset partitions`
partition_date_str = context.asset_partition_key_for_output()
@op
def leaf_op(root_op):
return 1
@graph
def my_graph():
return leaf_op(root_op())
AssetsDefinition.from_graph(my_graph, partitions_def=DailyPartitionsDefinition(start_date=DEFAULT_START))
owen
02/13/2023, 11:40 PMcontext.partition_key
which does not care if the given asset is associated with an asset key or not.Clement Emmanuel
02/13/2023, 11:48 PM