Replies: 4 comments 3 replies
-
A common case I have is something like this: @asset()
def asset_a():
pass
@asset(partitions_def=DailyPartitionsDefinition(start_date="2020-01-01"))
def asset_b():
pass
@asset(partitions_def=DailyPartitionsDefinition(start_date="2021-01-01"))
def downstream(asset_a, asset_b):
pass I want With |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
Hey @sryza |
Beta Was this translation helpful? Give feedback.
-
@sryza How do I perform "Automatically materialize both asset1 and asset2 when necessary in order to meet the freshness policy on asset2" in the new API? Is there an example I can take a look at? Thanks! |
Beta Was this translation helpful? Give feedback.
-
Motivation
We’ve heard requests for the ability to customize how assets are auto-materialized, on a few different dimensions:
Some users want to be able to set different policies on different assets, rather than a blanket policy across all assets.
Proposal
build_asset_reconciliation_sensor
.AutoMaterializationPolicy
, which determines under what conditions it should be automatically materialized.Code examples
Automatically materialize an asset whenever the assets directly upstream of it are materialized or are observed to have new data:
Automatically materialize an asset when necessary in order to meet its freshness policy:
Automatically materialize both
asset1
andasset2
when necessary in order to meet the freshness policy onasset2
:Apply the same
AutoMaterializationPolicy
to every asset within a given Python package:Parameters for
AutoMaterializationPolicy
on_missing
: Whether the asset should be materialized if it is missing.on_upstream_changed
: Whether the should be materialized eagerly after its upstream assets are materialized or are observed to have new data versions.for_freshness
: Whether the asset should be materialized at whatever time is necessary in order to satisfy downstream freshness policieson_code_version_changed
: Whether the asset should be materialized whenever its code version doesn’t match the code version used for its most recent materialization.min_minutes_between_materializations
: This asset should not be materialized more frequently than once per this many minutes.Beta Was this translation helpful? Give feedback.
All reactions