Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecating email, email_on_retry, email_on_failure in BaseOperator #45705

Open
wants to merge 6 commits into
base: v2-10-test
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 21 additions & 3 deletions airflow/models/baseoperator.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)}"
Expand Down
Loading