Repository: apache/airflow
File: providers/cncf/kubernetes/src/airflow/providers/cncf/kubernetes/operators/job.py (Python)

Code before:
log = logging.getLogger(__name__)

JOB_NAME_PREFIX = "job-"


class KubernetesJobOperator(KubernetesPodOperator):
    """
    Executes a Kubernetes Job.

    .. seealso::
        For more information on how to use this operator, take a look at the guide:
        :ref:`howto/operator:KubernetesJobOperator`

    .. note::
        If you use `Google Kubernetes Engine <https://cloud.google.com/kubernetes-engine/>`__
        and Airflow is not running in the same cluster, consider using
        :class:`~airflow.providers.google.cloud.operators.kubernetes_engine.GKEStartJobOperator`, which
        simplifies the authorization process.

    :param job_template_file: path to job template file (templated)
    :param full_job_spec: The complete JodSpec
    :param backoff_limit: Specifies the number of retries before marking this job failed. Defaults to 6
    :param completion_mode: CompletionMode specifies how Pod completions are tracked. It can be `NonIndexed` (default) or `Indexed`.
    :param completions: Specifies the desired number of successfully finished pods the job should be run with.
    :param manual_selector: manualSelector controls generation of pod labels and pod selectors.
    :param parallelism: Specifies the maximum desired number of pods the job should run at any given time. Defaults to 1
    :param selector: The selector of this V1JobSpec.
    :param suspend: Suspend specifies whether the Job controller should create Pods or not.
    :param ttl_seconds_after_finished: ttlSecondsAfterFinished limits the lifetime of a Job that has finished execution (either Complete or Failed).
    :param wait_until_job_complete: Whether to wait until started job finished execution (either Complete or
        Failed). Default is False.
    :param job_poll_interval: Interval in seconds between polling the job status. Default is 10.
        Used if the parameter `wait_until_job_complete` set True.
    :param deferrable: Run operator in the deferrable mode. Note that the parameter
        `wait_until_job_complete` must be set True.
    :param on_kill_propagation_policy: Whether and how garbage collection will be performed. Default is 'Foreground'.
        Acceptable values are:
        'Orphan' - orphan the dependents;
        'Background' - allow the garbage collector to delete the dependents in the background;
        'Foreground' - a cascading policy that deletes all dependents in the foreground.
        Default value is 'Foreground'.
    :param discover_pods_retry_number: Number of time list_namespaced_pod will be performed to discover
        already running pods.
    :param unwrap_single: Unwrap single result from the pod. For example, when set to `True` - if the XCom
        result should be `['res']`, the final result would be `'res'`. Default is True to support backward
        compatibility.
    """

    template_fields: Sequence[str] = tuple({"job_template_file"} | set(KubernetesPodOperator.template_fields))

    def __init__(

Review comment (suggestion):
See my other comments - it should be mentioned that the value should be `1` (default) or larger

Code after:

JOB_NAME_PREFIX = "job-"


class KubernetesJobOperator(KubernetesPodOperator):
    """
    Executes a Kubernetes Job.

    .. seealso::
        For more information on how to use this operator, take a look at the guide:
        :ref:`howto/operator:KubernetesJobOperator`

    .. note::
        If you use `Google Kubernetes Engine <https://cloud.google.com/kubernetes-engine/>`__
        and Airflow is not running in the same cluster, consider using
        :class:`~airflow.providers.google.cloud.operators.kubernetes_engine.GKEStartJobOperator`, which
        simplifies the authorization process.

    :param job_template_file: path to job template file (templated)
    :param full_job_spec: The complete JodSpec
    :param backoff_limit: Specifies the number of retries before marking this job failed. Defaults to 6
    :param completion_mode: CompletionMode specifies how Pod completions are tracked. It can be `NonIndexed` (default) or `Indexed`.
    :param completions: Specifies the desired number of successfully finished pods the job should be run with.
    :param manual_selector: manualSelector controls generation of pod labels and pod selectors.
    :param parallelism: Specifies the maximum desired number of pods the job should run at any given time.
        The value here must be >=1. Default value is 1
    :param selector: The selector of this V1JobSpec.
    :param suspend: Suspend specifies whether the Job controller should create Pods or not.
    :param ttl_seconds_after_finished: ttlSecondsAfterFinished limits the lifetime of a Job that has finished execution (either Complete or Failed).
    :param wait_until_job_complete: Whether to wait until started job finished execution (either Complete or
        Failed). Default is False.
    :param job_poll_interval: Interval in seconds between polling the job status. Default is 10.
        Used if the parameter `wait_until_job_complete` set True.
    :param deferrable: Run operator in the deferrable mode. Note that the parameter
        `wait_until_job_complete` must be set True.
    :param on_kill_propagation_policy: Whether and how garbage collection will be performed. Default is 'Foreground'.
        Acceptable values are:
        'Orphan' - orphan the dependents;
        'Background' - allow the garbage collector to delete the dependents in the background;
        'Foreground' - a cascading policy that deletes all dependents in the foreground.
        Default value is 'Foreground'.
    :param discover_pods_retry_number: Number of time list_namespaced_pod will be performed to discover
        already running pods.
    :param unwrap_single: Unwrap single result from the pod. For example, when set to `True` - if the XCom
        result should be `['res']`, the final result would be `'res'`. Default is True to support backward
        compatibility.
    """

    template_fields: Sequence[str] = tuple({"job_template_file"} | set(KubernetesPodOperator.template_fields))

    def __init__(