uranusjr commented on code in PR #68778: URL: https://github.com/apache/airflow/pull/68778#discussion_r3509135824
########## task-sdk/src/airflow/sdk/definitions/partition_mappers/rerun_policy.py: ########## @@ -0,0 +1,60 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +from __future__ import annotations + +from enum import Enum + + +class RerunPolicy(str, Enum): + """ + How a rollup reacts when an upstream partition is re-emitted after its downstream window already fired. + + A rollup fires its downstream Dag run once the window is satisfied (e.g. a + monthly rollup fires once all of March's daily partitions arrive). If an + upstream partition that the fired window already consumed is later cleared + and re-run, a fresh asset event arrives for an already-materialized window. + This policy decides what the scheduler does with it. + + ``HOLD`` (default): queue a provisional run that waits for the *entire* + window to re-materialize before firing again. A single re-run does not + re-fire; only a full recompute of the window does. This is the historical + behavior of a rollup before this policy existed, so it is the default to keep + existing Dags unchanged. Review Comment: This is only true for WaitForAll. If the wait policy is `MinimumCount`, a single re-run can re-fire before the whole window re-materializes. A reword to something like _re-evaluates the window through the wait policy_ would be nice. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
