Open cleboo opened 1 year ago
I think the main question here is how exactly the PartitionMapping
should be specified. I don't think it makes sense to make it an argument to AssetsDefinition.to_source_asset
, because source assets themselves don't have a PartitionMapping. Also, what if you wanted to depend on something that's already a SourceAsset
, not an AssetsDefinition
?
Maybe something like:
@asset(partitions_def=DailyPartitionsDefinition(start_date="2020-01-01")
def emails():
...
@job
def my_job():
send_emails(OpAssetInput(emails, partition_mapping=LastPartitionMapping()))
Makes sense to me 🙂 That could also be the manual way to specify the partition mapping for that issue: https://github.com/dagster-io/dagster/issues/13357
@sryza @cleboo This would be awesome, would allow us to also dynamically trigger jobs that depend on specific partition via parameters (#16524)
What's the use case?
I want to use the last partition of an asset as an input to a non-partitioned Job.
This can presently be done using an intermediate asset, however, that way a (potentially big) asset has to be materialized a second time.
Ideas of implementation
My rough idea of what this looks like from the users side would be something like this (using partition mappings):
Additional information
Original discussion: https://github.com/dagster-io/dagster/discussions/13918
Related to https://github.com/dagster-io/dagster/issues/13357
Message from the maintainers
Impacted by this issue? Give it a 👍! We factor engagement into prioritization.