-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[1.8][external assets] partitions_def on AssetSpec (#23201)
## Summary & Motivation Adds a `partitions_def` attribute to `AssetSpec`. This is a step towards deprecating `SourceAsset` in favor of `AssetSpec`. The biggest question this raises is what happens to `@multi_asset`, which accepts `AssetSpec`s and also a `partitions_def` argument. This PR retains the constraint that all the assets within a multi-asset must have the same `partitions_def`, though I hope to relax it soon after. Valid parameter combinations for `@multi_asset`: - `partitions_def` passed to `@multi_asset` is `None`, and `partitions_def`s passed to individual `AssetSpec`s are all none -> use `None`. - `partitions_def` passed to `@multi_asset` is X, and `partitions_def`s passed to individual `AssetSpec`s are all `None` -> use X. - `partitions_def` passed to `@multi_asset` is X, and `partitions_def`s passed to individual `AssetSpec`s are all X -> use X. - `partitions_def` passed to `@multi_asset` is `None`, and `partitions_def`s passed to individual `AssetSpec`s are all X -> use X. Invalid parameter combinations for `@multi_asset`: - `partitions_def`s passed to individual `AssetSpec`s are are not all the same. - In the future, we'll allow this, though require that the `partitions_def` passed to `@multi_asset` is `None`. - `partitions_def` passed to `@multi_asset` is X, and `partitions_def`s passed to individual `AssetSpec`s are all Y. A big question is whether we should deprecate the `partitions_def` argument to `@multi_asset` as part of this PR. I suspect we should eventually do this, but I think the disruption will be more palatable when users get something in return, like the ability to apply different `partitions_def`s to different assets within a multi-asset. ## How I Tested These Changes
- Loading branch information
Showing
6 changed files
with
134 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters