diff --git a/airflow/models/baseoperator.py b/airflow/models/baseoperator.py index 65900276271a6..125622b585708 100644 --- a/airflow/models/baseoperator.py +++ b/airflow/models/baseoperator.py @@ -610,11 +610,11 @@ class derived from this one results in the creation of a task object, (e.g. user/person/team/role name) to clarify ownership is recommended. :param email: the 'to' email address(es) used in email alerts. This can be a single email or multiple ones. Multiple addresses can be specified as a - comma or semicolon separated string or by passing a list of strings. + comma or semicolon separated string or by passing a list of strings. (deprecated) :param email_on_retry: Indicates whether email alerts should be sent when a - task is retried + task is retried (deprecated) :param email_on_failure: Indicates whether email alerts should be sent when - a task failed + a task failed (deprecated) :param retries: the number of retries that should be performed before failing the task :param retry_delay: delay between retries, can be set as ``timedelta`` or @@ -981,6 +981,24 @@ def __init__( self.email_on_retry = email_on_retry self.email_on_failure = email_on_failure + if email is not None: + warnings.warn( + "email is deprecated please migrate to SmtpNotifier`.", + RemovedInAirflow3Warning, + stacklevel=2, + ) + if email_on_retry is not None: + warnings.warn( + "email_on_retry is deprecated please migrate to SmtpNotifier`.", + RemovedInAirflow3Warning, + stacklevel=2, + ) + if email_on_failure is not None: + warnings.warn( + "email_on_retry is deprecated please migrate to SmtpNotifier`.", + RemovedInAirflow3Warning, + stacklevel=2, + ) if execution_timeout is not None and not isinstance(execution_timeout, timedelta): raise ValueError( f"execution_timeout must be timedelta object but passed as type: {type(execution_timeout)}"