Marcel Steinbach
03/06/2024, 4:53 PMScout
03/06/2024, 4:53 PMskip_on_backfill_in_progress
rule provided by Dagster's auto-materialization policies. This rule is designed to skip the auto-materialization of asset partitions if they are targeted by an in-progress backfill. Here's how you can use this rule according to the documentation: python from dagster import AutoMaterializePolicy, AutoMaterializeRule my_policy = AutoMaterializePolicy.eager().with_rules([ AutoMaterializeRule.skip_on_backfill_in_progress() ])
This policy will ensure that asset partitions targeted by an active backfill will not be auto-materialized. You can further customize the behavior of this rule by setting the all_partitions
parameter to True
or False
. If set to True
, it skips all partitions of the asset being backfilled, regardless of whether the specific partition is targeted by a backfill. If set to False
, it skips only partitions targeted by a backfill. Please note that this rule is part of the auto-materialization policy, and you would need to apply this policy to your assets for it to take effect.Marcel Steinbach
03/06/2024, 4:54 PMScout
03/06/2024, 4:54 PMMarcel Steinbach
03/06/2024, 5:04 PMScout
03/06/2024, 5:04 PMAutoMaterializeRule
classes directly. The AutoMaterializeRule
API provides a set of predefined rules that can be used to control the auto-materialization behavior of assets. These rules can be combined and configured to create an AutoMaterializePolicy
that suits your needs. The available rules include: - `materialize_on_cron`: Materialize an asset partition based on a cron schedule. - `materialize_on_missing`: Materialize an asset partition if it has never been materialized before. - `materialize_on_parent_updated`: Materialize an asset partition if one of its parents has been updated more recently than it has. - `materialize_on_required_for_freshness`: Materialize an asset partition if it is required to satisfy a freshness policy. - `skip_on_backfill_in_progress`: Skip an asset’s partitions if targeted by an in-progress backfill. - `skip_on_not_all_parents_updated`: Skip materializing an asset or partition if not all of its parents have been updated. These rules can be added to or removed from an AutoMaterializePolicy
using the with_rules
and without_rules
methods, respectively. If the predefined rules do not cover your specific use case, you might need to implement custom logic outside of the AutoMaterializeRule
framework. This could involve creating custom sensors or orchestration logic that triggers materializations under the conditions you define. For the most up-to-date information and potential new features, including the ability to write custom auto-materialization rules, please refer to the latest Dagster documentation or inquire with the Dagster community.