Martin Laurent
02/14/2024, 1:00 PMScout
02/14/2024, 1:00 PM@multi_asset
decorator, you can define a single op that produces multiple assets. This could allow you to encapsulate different logic paths within the same op and yield different assets based on some condition. However, this still results in multiple distinct assets, even if they are produced by the same op. 3. Use conditional logic within an op: You could define an op with conditional logic that determines which computation path to follow based on some input or configuration. This op would then be used in a software-defined asset. However, this approach might not be as clear or maintainable as having separate assets. 4. Use explicit AssetMaterialization: If you need to have more control over the materialization process, you could use ops with explicit AssetMaterialization
events. This would give you the flexibility to define exactly when and how an asset is considered materialized, but it requires a more manual approach and is less declarative than using software-defined assets. The documentation does not explicitly state a way to have two different logics for materializing the same asset using only software-defined assets without considering ops or explicit AssetMaterialization
. If you need further customization or control over the materialization process, using ops and explicit AssetMaterialization
might be necessary. Remember that the choice between these approaches depends on your specific use case and the trade-offs you are willing to make in terms of complexity, maintainability, and clarity of your asset definitions.