|
38 | 38 | from airflow.sdk import TriggerRule, timezone |
39 | 39 | from airflow.sdk._shared.secrets_masker import redact |
40 | 40 | from airflow.sdk.definitions._internal.abstractoperator import ( |
| 41 | + DEFAULT_EMAIL_ON_FAILURE, |
| 42 | + DEFAULT_EMAIL_ON_RETRY, |
41 | 43 | DEFAULT_IGNORE_FIRST_DEPENDS_ON_PAST, |
42 | 44 | DEFAULT_OWNER, |
43 | 45 | DEFAULT_POOL_NAME, |
@@ -219,8 +221,8 @@ def partial(**kwargs): |
219 | 221 | OPERATOR_DEFAULTS: dict[str, Any] = { |
220 | 222 | "allow_nested_operators": True, |
221 | 223 | "depends_on_past": False, |
222 | | - "email_on_failure": True, |
223 | | - "email_on_retry": True, |
| 224 | + "email_on_failure": DEFAULT_EMAIL_ON_FAILURE, |
| 225 | + "email_on_retry": DEFAULT_EMAIL_ON_RETRY, |
224 | 226 | "execution_timeout": DEFAULT_TASK_EXECUTION_TIMEOUT, |
225 | 227 | # "executor": DEFAULT_EXECUTOR, |
226 | 228 | "executor_config": {}, |
@@ -826,8 +828,8 @@ def say_hello_world(**context): |
826 | 828 | task_id: str |
827 | 829 | owner: str = DEFAULT_OWNER |
828 | 830 | email: str | Sequence[str] | None = None |
829 | | - email_on_retry: bool = True |
830 | | - email_on_failure: bool = True |
| 831 | + email_on_retry: bool = DEFAULT_EMAIL_ON_RETRY |
| 832 | + email_on_failure: bool = DEFAULT_EMAIL_ON_FAILURE |
831 | 833 | retries: int | None = DEFAULT_RETRIES |
832 | 834 | retry_delay: timedelta = DEFAULT_RETRY_DELAY |
833 | 835 | retry_exponential_backoff: float = 0 |
@@ -984,8 +986,8 @@ def __init__( |
984 | 986 | task_id: str, |
985 | 987 | owner: str = DEFAULT_OWNER, |
986 | 988 | email: str | Sequence[str] | None = None, |
987 | | - email_on_retry: bool = True, |
988 | | - email_on_failure: bool = True, |
| 989 | + email_on_retry: bool = DEFAULT_EMAIL_ON_RETRY, |
| 990 | + email_on_failure: bool = DEFAULT_EMAIL_ON_FAILURE, |
989 | 991 | retries: int | None = DEFAULT_RETRIES, |
990 | 992 | retry_delay: timedelta | float = DEFAULT_RETRY_DELAY, |
991 | 993 | retry_exponential_backoff: float = 0, |
|
0 commit comments