eladkal commented on code in PR #69914:
URL: https://github.com/apache/airflow/pull/69914#discussion_r3587783276
##########
providers/cncf/kubernetes/src/airflow/providers/cncf/kubernetes/operators/pod.py:
##########
@@ -170,8 +176,14 @@ class KubernetesPodOperator(BaseOperator):
:param in_cluster: run kubernetes client with in_cluster configuration.
:param cluster_context: context that points to kubernetes cluster.
Ignored when in_cluster is True. If None, current-context is used.
(templated)
- :param reattach_on_restart: if the worker dies while the pod is running,
reattach and monitor
- during the next try. If False, always create a new pod for each try.
+ :param reattach_on_restart: deprecated, use ``durable`` instead. If the
worker dies while the pod
+ is running, reattach and monitor during the next try. If False, always
create a new pod for
+ each try.
Review Comment:
```suggestion
:param reattach_on_restart: deprecated for Airflow 3.3+, use ``durable``
instead. If the worker dies while the pod
is running, reattach and monitor during the next try. If False,
always create a new pod for
each try.
```
##########
providers/cncf/kubernetes/src/airflow/providers/cncf/kubernetes/operators/pod.py:
##########
@@ -377,6 +389,18 @@ def __init__(
log_formatter: Callable[[str, str], str] | None = None,
**kwargs,
) -> None:
+ if "reattach_on_restart" in kwargs:
+ # Dropped from the named signature entirely so the warning fires
on any explicit use,
+ # `True` or `False`.
+ reattach_on_restart = kwargs.pop("reattach_on_restart")
+ if AIRFLOW_V_3_3_PLUS:
+ warnings.warn(
+ "`reattach_on_restart` is deprecated and will be removed
in a future release. "
+ "Use `durable` instead.",
+ AirflowProviderDeprecationWarning,
+ stacklevel=2,
+ )
+ durable = reattach_on_restart
Review Comment:
I think we need also the handle the case of `durable` with Airflow<3.3
I think for that case we want to just make it work as `reattach_on_restart`
so we want ask them to change parameter name but just handle this for them
under the hood?
##########
providers/cncf/kubernetes/src/airflow/providers/cncf/kubernetes/operators/pod.py:
##########
@@ -170,8 +176,14 @@ class KubernetesPodOperator(BaseOperator):
:param in_cluster: run kubernetes client with in_cluster configuration.
:param cluster_context: context that points to kubernetes cluster.
Ignored when in_cluster is True. If None, current-context is used.
(templated)
- :param reattach_on_restart: if the worker dies while the pod is running,
reattach and monitor
- during the next try. If False, always create a new pod for each try.
+ :param reattach_on_restart: deprecated, use ``durable`` instead. If the
worker dies while the pod
+ is running, reattach and monitor during the next try. If False, always
create a new pod for
+ each try.
+ :param durable: if the worker dies while the pod is running, reattach and
monitor during the next
+ try instead of creating a duplicate pod. If False, always create a new
pod for each try.
+ Supersedes ``reattach_on_restart``; on Airflow 3.3+ the reconnection
uses a persisted pod
+ identity in task state store instead of a label search, removing the
ambiguity failure a label
+ search can hit when more than one matching pod exists. Defaults to
``True``.
Review Comment:
```suggestion
:param durable: if the worker dies while the pod is running, reattach
and monitor during the next
try instead of creating a duplicate pod. If False, always create a
new pod for each try.
Supersedes ``reattach_on_restart``; on Airflow 3.3+ the reconnection
uses a persisted pod
identity in task state store instead of a label search, removing the
ambiguity failure a label
search can hit when more than one matching pod exists. Defaults to
``True``. Only available for Airflow 3.3+
```
--
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]